Browse Source

fixed multiline label positioning

pull/1/head
ands 10 years ago
parent
commit
eefa215873
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      blendish.h

+ 3
- 3
blendish.h View File

@@ -2153,17 +2153,17 @@ void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h,
+ nvgTextBounds(ctx, 1, 1, value, NULL, NULL); + nvgTextBounds(ctx, 1, 1, value, NULL, NULL);
x += ((w-BND_PAD_RIGHT-pleft)-width)*0.5f; x += ((w-BND_PAD_RIGHT-pleft)-width)*0.5f;
} }
y += h-BND_TEXT_PAD_DOWN;
y += BND_WIDGET_HEIGHT-BND_TEXT_PAD_DOWN;
nvgText(ctx, x, y, label, NULL); nvgText(ctx, x, y, label, NULL);
x += label_width; x += label_width;
nvgText(ctx, x, y, BND_LABEL_SEPARATOR, NULL); nvgText(ctx, x, y, BND_LABEL_SEPARATOR, NULL);
x += sep_width; x += sep_width;
nvgText(ctx, x, y, value, NULL);
nvgText(ctx, x, y, value, NULL);
} else { } else {
nvgTextAlign(ctx, nvgTextAlign(ctx,
(align==BND_LEFT)?(NVG_ALIGN_LEFT|NVG_ALIGN_BASELINE): (align==BND_LEFT)?(NVG_ALIGN_LEFT|NVG_ALIGN_BASELINE):
(NVG_ALIGN_CENTER|NVG_ALIGN_BASELINE)); (NVG_ALIGN_CENTER|NVG_ALIGN_BASELINE));
nvgTextBox(ctx,x+pleft,y+h-BND_TEXT_PAD_DOWN,
nvgTextBox(ctx,x+pleft,y+BND_WIDGET_HEIGHT-BND_TEXT_PAD_DOWN,
w-BND_PAD_RIGHT-pleft,label, NULL); w-BND_PAD_RIGHT-pleft,label, NULL);
} }
} else if (iconid >= 0) { } else if (iconid >= 0) {


Loading…
Cancel
Save