Skip to content

Commit 08d7026

Browse files
committed
Fix bug caused by missing synchronization
1 parent b434731 commit 08d7026

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sg2-app/src/cz/hartrik/sg2/app/FrameController.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,11 @@ public void initialize(java.net.URL url, java.util.ResourceBundle rb) {
149149
this.canvas = new CanvasWithCursor(scrollPane, fxCanvas);
150150

151151
controls.primaryToolProperty().addListener((ob, o, tool) -> {
152-
canvas.removeCursor();
153-
if (tool instanceof Cursorable)
154-
canvas.setCursor(((Cursorable) tool).createCursor(canvas));
152+
javafx.application.Platform.runLater(() -> {
153+
canvas.removeCursor();
154+
if (tool instanceof Cursorable)
155+
canvas.setCursor(((Cursorable) tool).createCursor(canvas));
156+
});
155157
});
156158

157159
controls.setPrimaryTool(ToolFactory.getInstance().centeredSquare(10));

0 commit comments

Comments
 (0)