Browse Source

Calculate bndLabelWidth for multiline strings.

master
Andrew Belt 6 years ago
parent
commit
79ec59e6bc
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      blendish.h

+ 3
- 1
blendish.h View File

@@ -1907,7 +1907,9 @@ float bndLabelWidth(NVGcontext *ctx, int iconid, const char *label) {
if (label && (bnd_font >= 0)) {
nvgFontFaceId(ctx, bnd_font);
nvgFontSize(ctx, BND_LABEL_FONT_SIZE);
w += nvgTextBounds(ctx, 1, 1, label, NULL, NULL);
float bounds[4];
nvgTextBoxBounds(ctx, 1, 1, INFINITY, label, NULL, bounds);
w += bounds[2];
}
return w;
}


Loading…
Cancel
Save