border shouldn't affect edit's area

This commit is contained in:
ryuukk 2024-09-24 14:09:16 +02:00 committed by GitHub
parent ca8aaf3f65
commit d557503366
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -174,10 +174,10 @@ nk_do_edit(nk_flags *state, struct nk_command_buffer *out,
return ret;
/* visible text area calculation */
area.x = bounds.x + style->padding.x + style->border;
area.y = bounds.y + style->padding.y + style->border;
area.w = bounds.w - (2.0f * style->padding.x + 2 * style->border);
area.h = bounds.h - (2.0f * style->padding.y + 2 * style->border);
area.x = bounds.x + style->padding.x;
area.y = bounds.y + style->padding.y;
area.w = bounds.w - (2.0f * style->padding.x);
area.h = bounds.h - (2.0f * style->padding.y);
if (flags & NK_EDIT_MULTILINE)
area.w = NK_MAX(0, area.w - style->scrollbar_size.x);
row_height = (flags & NK_EDIT_MULTILINE)? font->height + style->row_padding: area.h;