Skip to content

Commit

Permalink
Avoid extraneous call for DrawSelect in case of a zoom (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiolo authored Jan 16, 2024
1 parent 503f02c commit 045caf2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -667,17 +667,18 @@ struct Document {
sw->DoPrepareDC(dc);
ShiftToCenter(dc);
Render(dc);
DrawSelect(dc, selected);
if (hover.g) hover.g->DrawHover(this, dc, hover);
if (scaledviewingmode) { dc.SetUserScale(1, 1); }
if (initialzoomlevel) {
Zoom(initialzoomlevel, dc, false, true, false);
initialzoomlevel = 0;
} else {
DrawSelect(dc, selected);
}
if (scrolltoselection) {
ScrollIfSelectionOutOfView(dc, selected, false, false);
scrolltoselection = false;
}
if (hover.g) hover.g->DrawHover(this, dc, hover);
if (scaledviewingmode) { dc.SetUserScale(1, 1); }
}

void Print(wxDC &dc, wxPrintout &po) {
Expand Down

0 comments on commit 045caf2

Please sign in to comment.