summaryrefslogtreecommitdiff
path: root/src/ui/translation.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-07-06 07:04:29 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-07-06 07:04:29 +0300
commite1ff98965a4aec72418165424a0183e596df1ecb (patch)
treee01f245348ba39d2a2eb5fdffe5a8600e5928b96 /src/ui/translation.c
parent5915a8509827bbad99731b0e8451f484bff1ac61 (diff)
Text run measurement API change; bug fixes
The distinction between measure_Text and advance_Text was not very clear. Now there are only measure_Text functions that return both the bounds and the cursor position advancement, and the appropriate metrics are used by the caller.
Diffstat (limited to 'src/ui/translation.c')
-rw-r--r--src/ui/translation.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ui/translation.c b/src/ui/translation.c
index 88edc48b..3ffa961b 100644
--- a/src/ui/translation.c
+++ b/src/ui/translation.c
@@ -80,7 +80,7 @@ void init_TranslationProgressWidget(iTranslationProgressWidget *d) {
80 spr->color = 0; 80 spr->color = 0;
81 init_String(&spr->text); 81 init_String(&spr->text);
82 appendChar_String(&spr->text, chars[i]); 82 appendChar_String(&spr->text, chars[i]);
83 spr->xoff = (width - advanceRange_Text(d->font, range_String(&spr->text)).x) / 2; 83 spr->xoff = (width - measureRange_Text(d->font, range_String(&spr->text)).advance.x) / 2;
84 spr->size = init_I2(width, lineHeight_Text(d->font)); 84 spr->size = init_I2(width, lineHeight_Text(d->font));
85 x += width + gap; 85 x += width + gap;
86 } 86 }