Skip to content

Commit

Permalink
Update scrollbar after zoom on wxGTK (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiolo authored Aug 28, 2023
1 parent 50611ea commit 1a785ad
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,15 @@ struct Document {
#ifndef __WXMSW__
if (sw) sw->Refresh(false);
#endif
#ifdef __WXGTK__
if (sw) {
// wxWidgets (wxGTK) does not always automatically update the scrollbar
// to new canvas size and current position within after zoom so force it manually
int curx, cury;
sw->GetViewStart(&curx, &cury);
sw->SetScrollbars(1, 1, layoutxs, layoutys, curx, cury, true);
}
#endif
sys->UpdateStatus(selected);
sys->frame->nb->Refresh(false);
}
Expand Down

0 comments on commit 1a785ad

Please sign in to comment.