aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/right_panel/editor/EditorCanvas.cpp
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-06-05 18:55:14 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2023-06-05 18:55:14 +0200
commit7ea1e6dc2a0733647d39d8c49eb4e8c689ecfed0 (patch)
treeabb54e62fba9b0953be6eda3d86a661a4df05954 /src/game_tab/right_panel/editor/EditorCanvas.cpp
parent4a9523f9dfdea3d2eaebe0a159993492f701aebc (diff)
Improve UI
Diffstat (limited to 'src/game_tab/right_panel/editor/EditorCanvas.cpp')
-rw-r--r--src/game_tab/right_panel/editor/EditorCanvas.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game_tab/right_panel/editor/EditorCanvas.cpp b/src/game_tab/right_panel/editor/EditorCanvas.cpp
index ab56a8c..3120177 100644
--- a/src/game_tab/right_panel/editor/EditorCanvas.cpp
+++ b/src/game_tab/right_panel/editor/EditorCanvas.cpp
@@ -183,8 +183,13 @@ void EditorCanvas::MouseEvent(wxMouseEvent &event) {
void EditorCanvas::SetMoves(HalfMove *moves, HalfMove *current) {
CGEditor::status.Moves = moves;
CGEditor::status.CurrentMove = current;
-
Refresh();
+ // Focus on current move:
+ if(current!=nullptr){
+ Update(); // Wait for preview call to Refresh() to finish (otherwise heisenbugs)
+ CGEditor::FocusOnMove(current);
+ Refresh();
+ }
}
void EditorCanvas::ApplyPreferences(){