summaryrefslogtreecommitdiff
path: root/src/ui/documentwidget.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-10-07 08:49:42 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-10-07 08:49:42 +0300
commitc9ded71342f4e47b48151782a48fc488a5f63e56 (patch)
tree11b0b470f58bc3c39ad3b7d5b1715c6aed98d9b5 /src/ui/documentwidget.c
parentfa79abfe8bb9fcbdd4cf9cec46e0d1856f4e7020 (diff)
DocumentWidget: Line width based on font glyph width
The idea is that the amount of content should be the same per line regardless of the font.
Diffstat (limited to 'src/ui/documentwidget.c')
-rw-r--r--src/ui/documentwidget.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index b83490f9..2ba2fa12 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -496,7 +496,8 @@ static int documentWidth_DocumentWidget_(const iDocumentWidget *d) {
496 -1.0f, 10.0f); /* adapt to width */ 496 -1.0f, 10.0f); /* adapt to width */
497 //printf("%f\n", adjust); fflush(stdout); 497 //printf("%f\n", adjust); fflush(stdout);
498 return iMini(iMax(minWidth, bounds.size.x - gap_UI * (d->pageMargin + adjust) * 2), 498 return iMini(iMax(minWidth, bounds.size.x - gap_UI * (d->pageMargin + adjust) * 2),
499 fontSize_UI * prefs->lineWidth * prefs->zoomPercent / 100); 499 fontSize_UI * emRatio_Text(paragraph_FontId) * /* dependent on avg. glyph width */
500 prefs->lineWidth * prefs->zoomPercent / 100);
500} 501}
501 502
502static iRect documentBounds_DocumentWidget_(const iDocumentWidget *d) { 503static iRect documentBounds_DocumentWidget_(const iDocumentWidget *d) {