-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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: Check minSize constraints before resizing #14931
Conversation
args->GetNext(&animate); | ||
window_->SetSize(gfx::Size(width, height), animate); | ||
gfx::Size size = window_->GetMinimumSize(); | ||
if ((size.height() <= height) | (size.width() <= width)) { |
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.
it'd be better to snap to the smallest dimension rather than just fail to resize completely. e.g.
size.SetToMax(gfx::Size(width, height));
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.
Also the if-else blocks are nearly identical. If using SetToMax, the if-else could be removed with a single code path that uses the clamped size.
Release Notes Persisted
|
/trop run backport-to 3-0-x |
The backport process for this PR has been manually initiated, |
/trop run backport-to 2-0-x |
The backport process for this PR has been manually initiated, |
We have automatically backported this PR to "3-0-x", please check out #15038 |
fixes #13994
Currently, when developers sets an initial Minimum Height or Minimum Width the expected functionality is that the windows size cannot be changed manually unless the
minHeight
orminWidth
is changed. this PR sets enforcement of the the boundaries (if any) defined by the developer.Checklist
npm test
passesRelease Notes
Notes: Snap to minimum size possible when
setSize
is called below size constraints