fix: SetSize() should honor minSize (#13994) (#15052)

Manual backport of #14931 to fix #13994.
This commit is contained in:
Charles Kerr
2018-10-10 16:18:04 -05:00
committed by GitHub
parent 2663d3e10d
commit 28a160fc1f
2 changed files with 6 additions and 2 deletions

View File

@@ -450,9 +450,11 @@ gfx::Rect Window::GetContentBounds() {
}
void Window::SetSize(int width, int height, mate::Arguments* args) {
gfx::Size size = window_->GetMinimumSize();
size.SetToMax(gfx::Size(width, height));
bool animate = false;
args->GetNext(&animate);
window_->SetSize(gfx::Size(width, height), animate);
window_->SetSize(size, animate);
}
std::vector<int> Window::GetSize() {

View File

@@ -870,7 +870,9 @@ Disable or enable the window.
* `height` Integer
* `animate` Boolean (optional) _macOS_
Resizes the window to `width` and `height`.
Resizes the window to `width` and `height`. If `width` or `height`
are below any set minimum size constraints the window will snap to
its minimum size.
#### `win.getSize()`