diff options
Diffstat (limited to 'src/ui/labelwidget.c')
-rw-r--r-- | src/ui/labelwidget.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c index b68ab793..7d6bac67 100644 --- a/src/ui/labelwidget.c +++ b/src/ui/labelwidget.c | |||
@@ -376,9 +376,9 @@ static void sizeChanged_LabelWidget_(iLabelWidget *d) { | |||
376 | if (d->flags.wrap) { | 376 | if (d->flags.wrap) { |
377 | if (flags_Widget(w) & fixedHeight_WidgetFlag) { | 377 | if (flags_Widget(w) & fixedHeight_WidgetFlag) { |
378 | /* Calculate a new height based on the wrapping. */ | 378 | /* Calculate a new height based on the wrapping. */ |
379 | w->rect.size.y = advanceWrapRange_Text( | 379 | w->rect.size.y = measureWrapRange_Text( |
380 | d->font, innerBounds_Widget(w).size.x, range_String(&d->label)) | 380 | d->font, innerBounds_Widget(w).size.x, range_String(&d->label)) |
381 | .y; | 381 | .bounds.size.y; |
382 | } | 382 | } |
383 | } | 383 | } |
384 | } | 384 | } |
@@ -386,13 +386,13 @@ static void sizeChanged_LabelWidget_(iLabelWidget *d) { | |||
386 | iInt2 defaultSize_LabelWidget(const iLabelWidget *d) { | 386 | iInt2 defaultSize_LabelWidget(const iLabelWidget *d) { |
387 | const iWidget *w = constAs_Widget(d); | 387 | const iWidget *w = constAs_Widget(d); |
388 | const int64_t flags = flags_Widget(w); | 388 | const int64_t flags = flags_Widget(w); |
389 | iInt2 size = add_I2(measure_Text(d->font, cstr_String(&d->label)), | 389 | iInt2 size = add_I2(measure_Text(d->font, cstr_String(&d->label)).bounds.size, |
390 | add_I2(padding_LabelWidget_(d, 0), padding_LabelWidget_(d, 2))); | 390 | add_I2(padding_LabelWidget_(d, 0), padding_LabelWidget_(d, 2))); |
391 | if ((flags & drawKey_WidgetFlag) && d->key) { | 391 | if ((flags & drawKey_WidgetFlag) && d->key) { |
392 | iString str; | 392 | iString str; |
393 | init_String(&str); | 393 | init_String(&str); |
394 | keyStr_LabelWidget_(d, &str); | 394 | keyStr_LabelWidget_(d, &str); |
395 | size.x += 2 * gap_UI + measure_Text(uiShortcuts_FontId, cstr_String(&str)).x; | 395 | size.x += 2 * gap_UI + measure_Text(uiShortcuts_FontId, cstr_String(&str)).bounds.size.x; |
396 | deinit_String(&str); | 396 | deinit_String(&str); |
397 | } | 397 | } |
398 | size.x += iconPadding_LabelWidget_(d); | 398 | size.x += iconPadding_LabelWidget_(d); |