From d2a76230effce8586b7d90beff519e221e744bf7 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 19 May 2021 11:52:24 +0300 Subject: Widget: Fixed arrangement bug Whenever a widget is resized, we may need to rearrange its children. The up-to-date sizes must be used for determining positions for other children. --- src/ui/documentwidget.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ui/documentwidget.c') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index e227bcef..0906a1d4 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -571,10 +571,11 @@ static float normScrollPos_DocumentWidget_(const iDocumentWidget *d) { } static int scrollMax_DocumentWidget_(const iDocumentWidget *d) { - int sm = size_GmDocument(d->doc).y - height_Rect(bounds_Widget(constAs_Widget(d))) + + const iWidget *w = constAs_Widget(d); + int sm = size_GmDocument(d->doc).y - height_Rect(bounds_Widget(w)) + (hasSiteBanner_GmDocument(d->doc) ? 1 : 2) * d->pageMargin * gap_UI; if (d->phoneToolbar) { - sm += size_Root(constAs_Widget(d)->root).y - + sm += size_Root(w->root).y - top_Rect(boundsWithoutVisualOffset_Widget(d->phoneToolbar)); } return sm; -- cgit v1.2.3