summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-12-04 12:56:36 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-12-04 12:56:36 +0200
commitabec43cd54a14c6d4a74239df97870a83cc474ed (patch)
tree8099dba262c58c4eb53376a1f9e6ffaa7b2bcd2b /src/ui/documentwidget.c
parent39d66598f3641749bd3e2b9b2588e921912d4ec7 (diff)
SidebarWidget: Minimum and maximum widths considering both sidebars
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 0d931080..7cd51561 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -302,7 +302,7 @@ static int documentWidth_DocumentWidget_(const iDocumentWidget *d) {
302 const iWidget *w = constAs_Widget(d); 302 const iWidget *w = constAs_Widget(d);
303 const iRect bounds = bounds_Widget(w); 303 const iRect bounds = bounds_Widget(w);
304 const iPrefs * prefs = prefs_App(); 304 const iPrefs * prefs = prefs_App();
305 return iMini(bounds.size.x - gap_UI * d->pageMargin * 2, 305 return iMini(iMax(50 * gap_UI, bounds.size.x - gap_UI * d->pageMargin * 2),
306 fontSize_UI * prefs->lineWidth * prefs->zoomPercent / 100); 306 fontSize_UI * prefs->lineWidth * prefs->zoomPercent / 100);
307} 307}
308 308
@@ -2984,6 +2984,9 @@ static void draw_DocumentWidget_(const iDocumentWidget *d) {
2984 const iWidget *w = constAs_Widget(d); 2984 const iWidget *w = constAs_Widget(d);
2985 const iRect bounds = bounds_Widget(w); 2985 const iRect bounds = bounds_Widget(w);
2986 iVisBuf * visBuf = d->visBuf; /* will be updated now */ 2986 iVisBuf * visBuf = d->visBuf; /* will be updated now */
2987 if (width_Rect(bounds) <= 0) {
2988 return;
2989 }
2987 draw_Widget(w); 2990 draw_Widget(w);
2988 allocVisBuffer_DocumentWidget_(d); 2991 allocVisBuffer_DocumentWidget_(d);
2989 const iRect ctxWidgetBounds = init_Rect( 2992 const iRect ctxWidgetBounds = init_Rect(