mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-07 02:26:29 +02:00
Debug drawing canvas
This commit is contained in:
parent
29d5850b2f
commit
dd24427d81
3 changed files with 8 additions and 2 deletions
|
@ -16,7 +16,7 @@ BoardCanvas::BoardCanvas(wxFrame *parent)
|
||||||
ApplyPreferences();
|
ApplyPreferences();
|
||||||
// The following should be called when using an EVT_PAINT handler
|
// The following should be called when using an EVT_PAINT handler
|
||||||
SetBackgroundStyle(wxBG_STYLE_PAINT);
|
SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||||
adata.duration=5000;
|
adata.duration=200;
|
||||||
adata.duration_fast=80;
|
adata.duration_fast=80;
|
||||||
adata.fps=30;
|
adata.fps=30;
|
||||||
adata.buffer=new wxBitmap(500,500,32);
|
adata.buffer=new wxBitmap(500,500,32);
|
||||||
|
|
|
@ -134,6 +134,8 @@ bool Theme::Zoom(int amount) {
|
||||||
double width = skin_scaled['s']->GetWidth() + amount;
|
double width = skin_scaled['s']->GetWidth() + amount;
|
||||||
if(width<=20)
|
if(width<=20)
|
||||||
return false;
|
return false;
|
||||||
|
if(width>=180)
|
||||||
|
return false;
|
||||||
ResizeSquares(std::max(width, 1.0));
|
ResizeSquares(std::max(width, 1.0));
|
||||||
ResizePieces(std::max(width * PIECE_SIZE_FACTOR, 1.0));
|
ResizePieces(std::max(width * PIECE_SIZE_FACTOR, 1.0));
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -14,13 +14,17 @@ EditorCanvas::EditorCanvas(wxFrame *parent, std::shared_ptr<Game> game)
|
||||||
color_comments_bg=wxColour(255, 255, 204);
|
color_comments_bg=wxColour(255, 255, 204);
|
||||||
color_current_move_bg=wxColour(216, 216, 216);
|
color_current_move_bg=wxColour(216, 216, 216);
|
||||||
color_menu_item_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_DOWN, [p=this](wxKeyEvent &e){e.ResumePropagation(1);e.Skip();});
|
||||||
Bind(wxEVT_KEY_UP, [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) {
|
void EditorCanvas::OnPaint(wxPaintEvent &event) {
|
||||||
wxPaintDC current_dc(this);
|
wxPaintDC current_dc(this);
|
||||||
|
current_dc.SetBackground(*wxWHITE_BRUSH);
|
||||||
|
current_dc.Clear();
|
||||||
dc = ¤t_dc;
|
dc = ¤t_dc;
|
||||||
|
|
||||||
// Refresh canvas size
|
// Refresh canvas size
|
||||||
|
|
Loading…
Add table
Reference in a new issue