Skip to content

Commit

Permalink
Calculate bndLabelWidth for multiline strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
inniyah committed Aug 6, 2020
1 parent 02e2b8d commit 0e03f98
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/blendish.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,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;
}
Expand Down

0 comments on commit 0e03f98

Please sign in to comment.