Skip to content

Commit 9145d04

Browse files
committed
fix: resolve linux drawing issue
1 parent f7f998b commit 9145d04

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

include/gui.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class DrawPane : public wxPanel
3030

3131
private:
3232
std::string mode_;
33-
wxClientDC dc_;
3433
CLD cld_;
3534
cv::Mat dis_;
3635
};

src/gui.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ void MyFrame::OnIdle(wxIdleEvent &evt)
429429
DrawPane::DrawPane(wxPanel *parent, cv::Size s)
430430
: cld_(s)
431431
, wxPanel(parent)
432-
, dc_(wxClientDC(this))
433432
{
434433
}
435434

@@ -457,7 +456,8 @@ void DrawPane::render()
457456
}
458457

459458
wxBitmap bmp(wxImage(dis_.cols, dis_.rows, dis_.data, true));
460-
dc_.DrawBitmap(bmp, 0, 0);
459+
wxClientDC dc(this);
460+
dc.DrawBitmap(bmp, 0, 0);
461461
}
462462

463463
CLD &DrawPane::cld() { return cld_; }

0 commit comments

Comments
 (0)