summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-19 11:52:24 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-19 11:52:24 +0300
commitd2a76230effce8586b7d90beff519e221e744bf7 (patch)
treeec72b695c4d7e96f64219d5d8a754d37cce0e9db /src/ui/documentwidget.c
parent31840540e60d85ddef2642d9a748258d45241186 (diff)
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.
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c5
1 files changed, 3 insertions, 2 deletions
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) {
571} 571}
572 572
573static int scrollMax_DocumentWidget_(const iDocumentWidget *d) { 573static int scrollMax_DocumentWidget_(const iDocumentWidget *d) {
574 int sm = size_GmDocument(d->doc).y - height_Rect(bounds_Widget(constAs_Widget(d))) + 574 const iWidget *w = constAs_Widget(d);
575 int sm = size_GmDocument(d->doc).y - height_Rect(bounds_Widget(w)) +
575 (hasSiteBanner_GmDocument(d->doc) ? 1 : 2) * d->pageMargin * gap_UI; 576 (hasSiteBanner_GmDocument(d->doc) ? 1 : 2) * d->pageMargin * gap_UI;
576 if (d->phoneToolbar) { 577 if (d->phoneToolbar) {
577 sm += size_Root(constAs_Widget(d)->root).y - 578 sm += size_Root(w->root).y -
578 top_Rect(boundsWithoutVisualOffset_Widget(d->phoneToolbar)); 579 top_Rect(boundsWithoutVisualOffset_Widget(d->phoneToolbar));
579 } 580 }
580 return sm; 581 return sm;