mirror of
https://github.com/Immediate-Mode-UI/Nuklear.git
synced 2026-11-30 16:48:10 +01:00
fixed 'unsigned short' overflow when
drawing widget text with font size > widget height
This commit is contained in:
@@ -11259,7 +11259,7 @@ nk_widget_text(struct nk_command_buffer *o, struct nk_rect b,
|
||||
/* align in y-axis */
|
||||
if (a & NK_TEXT_ALIGN_MIDDLE) {
|
||||
label.y = b.y + b.h/2.0f - (float)f->height/2.0f;
|
||||
label.h = b.h - (b.h/2.0f + f->height/2.0f);
|
||||
label.h = NK_MAX(b.h/2.0f, b.h - (b.h/2.0f + f->height/2.0f));
|
||||
} else if (a & NK_TEXT_ALIGN_BOTTOM) {
|
||||
label.y = b.y + b.h - f->height;
|
||||
label.h = f->height;
|
||||
|
||||
Reference in New Issue
Block a user