Skip to content

Commit

Permalink
Always show scrollbars, ensure that timer is stopped
Browse files Browse the repository at this point in the history
Under HiDPI, the canvas keeps going back and forth seeing if it needs scrollbars and sometimes this leads to the resize event firing over and over again in a loop
  • Loading branch information
Blake-Madden committed Sep 14, 2024
1 parent 9b882d1 commit f93d0a7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/base/canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ namespace Wisteria
Canvas::Canvas(wxWindow* parent, int itemId, const wxPoint& pos, const wxSize& size,
const long flags)
: wxScrolledWindow(parent, itemId, pos, size,
flags | wxBORDER_NONE | wxVSCROLL | wxHSCROLL | wxFULL_REPAINT_ON_RESIZE)
flags | wxBORDER_NONE | wxVSCROLL | wxHSCROLL |
wxALWAYS_SHOW_SB | wxFULL_REPAINT_ON_RESIZE)
{
m_watermarkFont.MakeBold();
SetCanvasMinWidthDIPs(GetDefaultCanvasWidthDIPs());
Expand Down Expand Up @@ -709,15 +710,13 @@ namespace Wisteria
{
if (m_delayResize && m_blockResize)
{
if (m_resizeTimer.IsRunning())
{
m_resizeTimer.Stop();
}
m_resizeTimer.Stop();
m_resizeTimer.StartOnce(500); // half a second
event.Skip();
return;
}

m_resizeTimer.Stop();
m_blockResize = true;

wxGCDC gdc(this);
Expand Down

0 comments on commit f93d0a7

Please sign in to comment.