mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
@@ -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() {
|
||||
|
||||
@@ -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()`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user