Skip to content

Commit

Permalink
Paint directly on Linux (#274)
Browse files Browse the repository at this point in the history
Instead of using a bitmap for double-buffering, draw directly
like on MacOS. This avoids the case that the bitmap has to be resized
for HiDPI scaling. Instead, scaling is considered during the paint.

This fixes #253 for Linux (wxGTK).
  • Loading branch information
tobiolo authored Oct 20, 2022
1 parent be79e53 commit 12580ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mycanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ struct TSCanvas : public wxScrolledWindow {
void OnPaint(wxPaintEvent &event) {
#ifdef __WXMAC__
wxPaintDC dc(this);
#elif __WXGTK__
wxPaintDC dc(this);
#else
auto sz = GetClientSize();
if (sz.GetX() <= 0 || sz.GetY() <= 0) return;
Expand Down

0 comments on commit 12580ce

Please sign in to comment.