Skip to content

Commit

Permalink
Align selection to center
Browse files Browse the repository at this point in the history
This aligns the selection to center when selection was out of view before.
  • Loading branch information
tobiolo committed Aug 27, 2023
1 parent 50611ea commit 02fab23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/document.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ struct Document {
sw->SetScrollbars(1, 1, layoutxs, layoutys,
r.width > canvasw || r.x < originx
? r.x
: r.x + r.width > maxx ? r.x + r.width - canvasw : curx,
: r.x + r.width > maxx ? r.x + r.width / 2 - canvasw / 2 : curx,
r.height > canvash || r.y < originy
? r.y
: r.y + r.height > maxy ? r.y + r.height - canvash : cury,
: r.y + r.height > maxy ? r.y + r.height / 2 - canvash / 2 : cury,
true);
RefreshReset();
return true;
Expand Down

0 comments on commit 02fab23

Please sign in to comment.