-
Notifications
You must be signed in to change notification settings - Fork 518
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 incorrect widget LEFT state #559
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that I'm a maintainer but the changes look good 👍
Thanks for pushing this forwards! Could you indicate how we can test this out? Would love to get it in, but I'm not sure how to properly test it. |
@@ -34,8 +34,7 @@ nk_widget_text(struct nk_command_buffer *o, struct nk_rect b, | |||
label.w = NK_MAX(1, 2 * t->padding.x + (float)text_width); | |||
label.x = (b.x + t->padding.x + ((b.w - 2 * t->padding.x) - label.w) / 2); | |||
label.x = NK_MAX(b.x + t->padding.x, label.x); | |||
label.w = NK_MIN(b.x + b.w, label.x + label.w); | |||
if (label.w >= label.x) label.w -= label.x; | |||
label.w = NK_MIN(b.w, label.w); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks unrelated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label.w = NK_MIN(b.w, label.w); | |
label.w = NK_MIN(b.x + b.w, label.x + label.w); | |
if (label.w >= label.x) label.w -= label.x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x+w
is the coordinate, w
is the distance, and the physical meaning of associating these two quantities seems incorrect
No description provided.