From 02fab238be6cdff96404751981b2921c5a31bc39 Mon Sep 17 00:00:00 2001 From: Tobias Predel Date: Sun, 27 Aug 2023 12:43:42 +0200 Subject: [PATCH] Align selection to center This aligns the selection to center when selection was out of view before. --- src/document.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/document.h b/src/document.h index b8592274..59dd0860 100755 --- a/src/document.h +++ b/src/document.h @@ -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;