summaryrefslogtreecommitdiff
path: root/src/gmdocument.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-04 14:54:02 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-04 14:54:02 +0300
commit137d5b32a4b8d29e9a9578a1fb47c673290647be (patch)
tree96b69b479aa6d14e88b0da5cfa664c7dfcddb634 /src/gmdocument.c
parenteb1e613d1309c51e299888290766896a850e9171 (diff)
Changing the document content text size
The glyph cache is purged whenever font sizes change. UI fonts are deliberately not changed in size so that UI metrics don't have to be recomputed.
Diffstat (limited to 'src/gmdocument.c')
-rw-r--r--src/gmdocument.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index cf30a081..cb9e2acb 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -382,9 +382,9 @@ static void doLayout_GmDocument_(iGmDocument *d) {
382 /* List bullet. */ 382 /* List bullet. */
383 run.color = colors[type]; 383 run.color = colors[type];
384 if (type == bullet_GmLineType) { 384 if (type == bullet_GmLineType) {
385 run.visBounds.pos = addX_I2(pos, indent * gap_UI); 385 run.visBounds.pos = addX_I2(pos, indent * gap_Text);
386 run.visBounds.size = advance_Text(run.font, bullet); 386 run.visBounds.size = advance_Text(run.font, bullet);
387 run.visBounds.pos.x -= 4 * gap_UI - width_Rect(run.visBounds) / 2; 387 run.visBounds.pos.x -= 4 * gap_Text - width_Rect(run.visBounds) / 2;
388 run.bounds = zero_Rect(); /* just visual */ 388 run.bounds = zero_Rect(); /* just visual */
389 run.text = range_CStr(bullet); 389 run.text = range_CStr(bullet);
390 pushBack_Array(&d->layout, &run); 390 pushBack_Array(&d->layout, &run);
@@ -392,14 +392,14 @@ static void doLayout_GmDocument_(iGmDocument *d) {
392 /* Link icon. */ 392 /* Link icon. */
393 if (type == link_GmLineType) { 393 if (type == link_GmLineType) {
394 run.visBounds.pos = pos; 394 run.visBounds.pos = pos;
395 run.visBounds.size = init_I2(indent * gap_UI, lineHeight_Text(run.font)); 395 run.visBounds.size = init_I2(indent * gap_Text, lineHeight_Text(run.font));
396 run.bounds = zero_Rect(); /* just visual */ 396 run.bounds = zero_Rect(); /* just visual */
397 const iGmLink *link = constAt_PtrArray(&d->links, run.linkId - 1); 397 const iGmLink *link = constAt_PtrArray(&d->links, run.linkId - 1);
398 run.text = range_CStr(link->flags & file_GmLinkFlag 398 run.text = range_CStr(link->flags & file_GmLinkFlag
399 ? folder 399 ? folder
400 : link->flags & remote_GmLinkFlag ? globe : arrow); 400 : link->flags & remote_GmLinkFlag ? globe : arrow);
401 if (link->flags & remote_GmLinkFlag) { 401 if (link->flags & remote_GmLinkFlag) {
402 run.visBounds.pos.x -= gap_UI / 2; 402 run.visBounds.pos.x -= gap_Text / 2;
403 } 403 }
404 run.color = linkColor_GmDocument(d, run.linkId); 404 run.color = linkColor_GmDocument(d, run.linkId);
405 if (link->flags & visited_GmLinkFlag) { 405 if (link->flags & visited_GmLinkFlag) {
@@ -433,7 +433,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
433 runLine.start != line.start) { 433 runLine.start != line.start) {
434 pos.y += midRunSkip * lineHeight_Text(run.font); 434 pos.y += midRunSkip * lineHeight_Text(run.font);
435 } 435 }
436 run.bounds.pos = addX_I2(pos, indent * gap_UI); 436 run.bounds.pos = addX_I2(pos, indent * gap_Text);
437 const char *contPos; 437 const char *contPos;
438 const int avail = d->size.x - run.bounds.pos.x; 438 const int avail = d->size.x - run.bounds.pos.x;
439 const iInt2 dims = 439 const iInt2 dims =