summaryrefslogtreecommitdiff
path: root/src/ui/util.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/util.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/util.c')
-rw-r--r--src/ui/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index e0b05a44..570bae85 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1648,9 +1648,9 @@ iWidget *makePreferences_Widget(void) {
1648 size_t widestPos = iInvalidPos; 1648 size_t widestPos = iInvalidPos;
1649 iConstForEach(Array, i, uiLangs) { 1649 iConstForEach(Array, i, uiLangs) {
1650 const int width = 1650 const int width =
1651 advance_Text(uiLabel_FontId, 1651 measure_Text(uiLabel_FontId,
1652 translateCStr_Lang(((const iMenuItem *) i.value)->label)) 1652 translateCStr_Lang(((const iMenuItem *) i.value)->label))
1653 .x; 1653 .advance.x;
1654 if (widestPos == iInvalidPos || width > widest) { 1654 if (widestPos == iInvalidPos || width > widest) {
1655 widest = width; 1655 widest = width;
1656 widestPos = index_ArrayConstIterator(&i); 1656 widestPos = index_ArrayConstIterator(&i);