mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-01-07 23:31:27 +00:00
Merge pull request #21 from doyousketch2/master
Update size of cursorAssistant when you zoom.
This commit is contained in:
commit
e09405b5cb
@ -69,6 +69,7 @@ public class MapEditor extends Editor<Map, MapEditor.DrawMode> implements EventH
|
|||||||
TileMap currentMap;
|
TileMap currentMap;
|
||||||
double tileWidth = getCurrentPlatform().tileRenderer.getWidth() * zoom;
|
double tileWidth = getCurrentPlatform().tileRenderer.getWidth() * zoom;
|
||||||
double tileHeight = getCurrentPlatform().tileRenderer.getHeight() * zoom;
|
double tileHeight = getCurrentPlatform().tileRenderer.getHeight() * zoom;
|
||||||
|
Color cursorAssistColor = new Color(0.2, 0.2, 1.0, 0.4);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onEntityUpdated() {
|
protected void onEntityUpdated() {
|
||||||
@ -154,7 +155,7 @@ public class MapEditor extends Editor<Map, MapEditor.DrawMode> implements EventH
|
|||||||
drawCanvas.setOnMouseDragReleased(this);
|
drawCanvas.setOnMouseDragReleased(this);
|
||||||
drawCanvas.setOnMouseReleased(this);
|
drawCanvas.setOnMouseReleased(this);
|
||||||
anchorPane.getChildren().add(0, drawCanvas);
|
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.setMouseTransparent(true);
|
||||||
cursorAssistant.setEffect(new Glow(1.0));
|
cursorAssistant.setEffect(new Glow(1.0));
|
||||||
anchorPane.getChildren().add(cursorAssistant);
|
anchorPane.getChildren().add(cursorAssistant);
|
||||||
@ -497,6 +498,8 @@ public class MapEditor extends Editor<Map, MapEditor.DrawMode> implements EventH
|
|||||||
cursorAssistant.setVisible(false);
|
cursorAssistant.setVisible(false);
|
||||||
} else {
|
} else {
|
||||||
cursorAssistant.setVisible(true);
|
cursorAssistant.setVisible(true);
|
||||||
|
cursorAssistant.setWidth(tileWidth);
|
||||||
|
cursorAssistant.setHeight(tileHeight);
|
||||||
cursorAssistant.setTranslateX(t.getX() - (t.getX() % tileWidth));
|
cursorAssistant.setTranslateX(t.getX() - (t.getX() % tileWidth));
|
||||||
cursorAssistant.setTranslateY(t.getY() - (t.getY() % tileHeight));
|
cursorAssistant.setTranslateY(t.getY() - (t.getY() % tileHeight));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user