mirror of
https://gitlab.com/manzerbredes/ochess.git
synced 2025-04-06 01:56:28 +02:00
Update
This commit is contained in:
parent
ea76a42c6b
commit
f0e6f0b665
1 changed files with 6 additions and 1 deletions
|
@ -22,6 +22,9 @@ BoardCanvas::BoardCanvas(wxFrame *parent)
|
|||
// Let GameTableLeftPanel process keyboard events:
|
||||
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_PAINT, &BoardCanvas::OnPaint, this);
|
||||
//Bind(wxEVT_IDLE, [p=this](wxIdleEvent& event){p->Refresh();p->Update();});
|
||||
|
||||
}
|
||||
|
||||
BoardCanvas::~BoardCanvas() {
|
||||
|
@ -44,6 +47,7 @@ void BoardCanvas::OnPaint(wxPaintEvent &event) {
|
|||
wxBufferedPaintDC dc(this);
|
||||
dc.SetBackground(*wxWHITE_BRUSH);
|
||||
dc.Clear();
|
||||
wxLogDebug("lll");
|
||||
|
||||
if(!adata.reuseBuffer){
|
||||
// Setting up required attributes
|
||||
|
@ -73,6 +77,7 @@ void BoardCanvas::OnPaint(wxPaintEvent &event) {
|
|||
dc.DrawBitmap(*t->Get(adata.piece_moved),
|
||||
adata.src.x + adata.frame*(adata.transVect.x/adata.frames),
|
||||
adata.src.y + adata.frame*(adata.transVect.y/adata.frames), false);
|
||||
wxLogDebug("Here: %d",(int)adata.src.y + adata.frame*(adata.transVect.y/adata.frames));
|
||||
// end drawing
|
||||
adata.frame++;
|
||||
}
|
||||
|
@ -404,6 +409,6 @@ void BoardCanvas::SetClockTime(short hours, short min, short sec,
|
|||
}
|
||||
}
|
||||
|
||||
wxBEGIN_EVENT_TABLE(BoardCanvas, wxPanel) EVT_PAINT(BoardCanvas::OnPaint)
|
||||
wxBEGIN_EVENT_TABLE(BoardCanvas, wxPanel)
|
||||
EVT_MOUSE_EVENTS(BoardCanvas::MouseEvent)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
|
Loading…
Add table
Reference in a new issue