From 30e9960ca53695e52023a4bbb3965520927111e6 Mon Sep 17 00:00:00 2001 From: Doyousketch2 Date: Thu, 25 Aug 2016 15:15:19 -0400 Subject: [PATCH] Update size of cursorAssistant when you zoom. --- .../src/main/java/org/badvision/outlaweditor/MapEditor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OutlawEditor/src/main/java/org/badvision/outlaweditor/MapEditor.java b/OutlawEditor/src/main/java/org/badvision/outlaweditor/MapEditor.java index a77a9da9..214d4ad4 100644 --- a/OutlawEditor/src/main/java/org/badvision/outlaweditor/MapEditor.java +++ b/OutlawEditor/src/main/java/org/badvision/outlaweditor/MapEditor.java @@ -69,6 +69,7 @@ public class MapEditor extends Editor implements EventH TileMap currentMap; double tileWidth = getCurrentPlatform().tileRenderer.getWidth() * zoom; double tileHeight = getCurrentPlatform().tileRenderer.getHeight() * zoom; + Color cursorAssistColor = new Color(0.2, 0.2, 1.0, 0.4); @Override protected void onEntityUpdated() { @@ -154,7 +155,7 @@ public class MapEditor extends Editor implements EventH drawCanvas.setOnMouseDragReleased(this); drawCanvas.setOnMouseReleased(this); anchorPane.getChildren().add(0, drawCanvas); - cursorAssistant = new Rectangle(tileWidth, tileHeight, new Color(0.2, 0.2, 1.0, 0.4)); + cursorAssistant = new Rectangle(tileWidth, tileHeight, cursorAssistColor); cursorAssistant.setMouseTransparent(true); cursorAssistant.setEffect(new Glow(1.0)); anchorPane.getChildren().add(cursorAssistant); @@ -497,6 +498,8 @@ public class MapEditor extends Editor implements EventH cursorAssistant.setVisible(false); } else { cursorAssistant.setVisible(true); + cursorAssistant.setWidth(tileWidth); + cursorAssistant.setHeight(tileHeight); cursorAssistant.setTranslateX(t.getX() - (t.getX() % tileWidth)); cursorAssistant.setTranslateY(t.getY() - (t.getY() % tileHeight)); }