Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Edit Widget's border area around text #702

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -27979,10 +27979,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;
Expand Down Expand Up @@ -30698,6 +30698,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
/// - [y]: Minor version with non-breaking API and library changes
/// - [z]: Patch version with no direct changes to the API
///
/// - 2024/12/07 (4.12.3) - Fix border impacting edit widget's text
/// - 2024/11/20 (4.12.2) - Fix int/float type conversion warnings in `nk_roundf`
/// - 2024/03/07 (4.12.1) - Fix bitwise operations warnings in C++20
/// - 2023/11/26 (4.12.0) - Added an alignment option to checkboxes and radio buttons.
Expand Down
1 change: 1 addition & 0 deletions src/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/// - [y]: Minor version with non-breaking API and library changes
/// - [z]: Patch version with no direct changes to the API
///
/// - 2024/12/07 (4.12.3) - Fix border impacting edit widget's text
/// - 2024/11/20 (4.12.2) - Fix int/float type conversion warnings in `nk_roundf`
/// - 2024/03/07 (4.12.1) - Fix bitwise operations warnings in C++20
/// - 2023/11/26 (4.12.0) - Added an alignment option to checkboxes and radio buttons.
Expand Down
8 changes: 4 additions & 4 deletions src/nuklear_edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading