diff options
| m--------- | libs/cgeditor | 0 | ||||
| -rw-r--r-- | src/game_tab/left_panel/GameTabLeftPanel.cpp | 2 | ||||
| -rw-r--r-- | src/game_tab/right_panel/editor/EditorCanvas.cpp | 8 |
3 files changed, 2 insertions, 8 deletions
diff --git a/libs/cgeditor b/libs/cgeditor -Subproject 31c332da9ab426daa73b68772d0ef9c1b0744a5 +Subproject 5e18d43a6ba4fd378178418de6b2ca7a67d64c2 diff --git a/src/game_tab/left_panel/GameTabLeftPanel.cpp b/src/game_tab/left_panel/GameTabLeftPanel.cpp index fd89791..fa97f6f 100644 --- a/src/game_tab/left_panel/GameTabLeftPanel.cpp +++ b/src/game_tab/left_panel/GameTabLeftPanel.cpp @@ -63,12 +63,12 @@ GameTabLeftPanel::GameTabLeftPanel(wxFrame *parent, std::shared_ptr<Game> game) void GameTabLeftPanel::OnPlay(wxCommandEvent &event) { wxLogDebug("Game tab received PLAY_MOVE_EVENT"); if (game->Play(event.GetString().ToStdString())) { - Notify(true); // Notify other classes wxCommandEvent event(GAME_CHANGE, GetId()); event.SetEventObject(this); ProcessEvent(event); } + Notify(true); // Redraw event is move failed! Otherwise piece not resets to it initial position after dragging } void GameTabLeftPanel::Notify(bool skip_animation) { diff --git a/src/game_tab/right_panel/editor/EditorCanvas.cpp b/src/game_tab/right_panel/editor/EditorCanvas.cpp index 5a0afd0..19d81ec 100644 --- a/src/game_tab/right_panel/editor/EditorCanvas.cpp +++ b/src/game_tab/right_panel/editor/EditorCanvas.cpp @@ -216,13 +216,7 @@ void EditorCanvas::MouseEvent(wxMouseEvent &event) { // Handle editor events Update(); - bool need_redraw=false; - for(auto event: status.Events){ - HandleEvent(event); - need_redraw=true; - } - if(need_redraw){ - status.Events.clear(); + if(ProcessEvents()){ Refresh(); Update(); } |
