diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-01 20:28:39 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-01-01 20:28:39 +0100 |
| commit | dd24427d81d04765cbe3426b511b1ad05952d087 (patch) | |
| tree | 6a5d40cdd07fbd2cd3aff51b449f27ba4c0228ac | |
| parent | 29d5850b2f44ad520fc89324a110a721ac08841b (diff) | |
Debug drawing canvas
| -rw-r--r-- | src/game_tab/left_panel/board/BoardCanvas.cpp | 2 | ||||
| -rw-r--r-- | src/game_tab/left_panel/board/Theme.cpp | 2 | ||||
| -rw-r--r-- | src/game_tab/right_panel/editor/EditorCanvas.cpp | 6 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/game_tab/left_panel/board/BoardCanvas.cpp b/src/game_tab/left_panel/board/BoardCanvas.cpp index 5297250..0e44979 100644 --- a/src/game_tab/left_panel/board/BoardCanvas.cpp +++ b/src/game_tab/left_panel/board/BoardCanvas.cpp @@ -16,7 +16,7 @@ BoardCanvas::BoardCanvas(wxFrame *parent) ApplyPreferences(); // The following should be called when using an EVT_PAINT handler SetBackgroundStyle(wxBG_STYLE_PAINT); - adata.duration=5000; + adata.duration=200; adata.duration_fast=80; adata.fps=30; adata.buffer=new wxBitmap(500,500,32); diff --git a/src/game_tab/left_panel/board/Theme.cpp b/src/game_tab/left_panel/board/Theme.cpp index 0c05fa1..6c662dc 100644 --- a/src/game_tab/left_panel/board/Theme.cpp +++ b/src/game_tab/left_panel/board/Theme.cpp @@ -134,6 +134,8 @@ bool Theme::Zoom(int amount) { double width = skin_scaled['s']->GetWidth() + amount; if(width<=20) return false; + if(width>=180) + return false; ResizeSquares(std::max(width, 1.0)); ResizePieces(std::max(width * PIECE_SIZE_FACTOR, 1.0)); return true; diff --git a/src/game_tab/right_panel/editor/EditorCanvas.cpp b/src/game_tab/right_panel/editor/EditorCanvas.cpp index 3856102..5a0afd0 100644 --- a/src/game_tab/right_panel/editor/EditorCanvas.cpp +++ b/src/game_tab/right_panel/editor/EditorCanvas.cpp @@ -14,13 +14,17 @@ EditorCanvas::EditorCanvas(wxFrame *parent, std::shared_ptr<Game> game) color_comments_bg=wxColour(255, 255, 204); color_current_move_bg=wxColour(216, 216, 216); color_menu_item_bg=wxColour(216, 216, 216); - + // The following should be called when using an EVT_PAINT handler + SetBackgroundStyle(wxBG_STYLE_PAINT); + Bind(wxEVT_KEY_DOWN, [p=this](wxKeyEvent &e){e.ResumePropagation(1);e.Skip();}); Bind(wxEVT_KEY_UP, [p=this](wxKeyEvent &e){e.ResumePropagation(1);e.Skip();}); } void EditorCanvas::OnPaint(wxPaintEvent &event) { wxPaintDC current_dc(this); + current_dc.SetBackground(*wxWHITE_BRUSH); + current_dc.Clear(); dc = ¤t_dc; // Refresh canvas size |
