-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Update the minimum size of Label if necessary when resizing #77573
Update the minimum size of Label if necessary when resizing #77573
Conversation
You probably want to fix the spelling error in "Label". 😛 |
544d368
to
cc68dfe
Compare
Previously, the necessary call to update the minimum size was missing.
cc68dfe
to
45ac7e3
Compare
@@ -654,7 +654,10 @@ void Label::_notification(int p_what) { | |||
} break; | |||
|
|||
case NOTIFICATION_RESIZED: { | |||
lines_dirty = true; | |||
if (autowrap_mode != TextServer::AUTOWRAP_OFF || overrun_behavior != TextServer::OVERRUN_NO_TRIMMING) { |
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 feels wrong because at the end of _shape
we already call update_minimum_size()
but for the opposite checks. Are you sure it's here where we're supposed to fix it?
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.
For these modes and behaviors, a change in size may result in a change in the minimum size. The minimum height varies due to the size's width in these modes.
Lines 676 to 683 in 2f57da2
if (autowrap_mode != TextServer::AUTOWRAP_OFF) { | |
return Size2(1, (clip || overrun_behavior != TextServer::OVERRUN_NO_TRIMMING) ? 1 : min_size.height) + min_style; | |
} else { | |
if (clip || overrun_behavior != TextServer::OVERRUN_NO_TRIMMING) { | |
min_size.width = 1; | |
} | |
return min_size + min_style; | |
} |
Under the opposite option, changing the size does not actually change the minimum size. Calling update_minimum_size()
in _shape()
does not seem necessary unless you just switched to these options.
Superseded by #77651. |
Previously, the necessary call to update the minimum size was missing.
Fixes #74052.
Supersedes #77568.