mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Merge pull request #2250 from EyeSee360/master
Maintain an aspect ratio for content within a window
This commit is contained in:
@@ -249,6 +249,10 @@ bool Window::IsFullscreen() {
|
||||
return window_->IsFullscreen();
|
||||
}
|
||||
|
||||
void Window::SetAspectRatio(double aspectRatio, gfx::Size extraSize) {
|
||||
window_->SetAspectRatio(aspectRatio, extraSize);
|
||||
}
|
||||
|
||||
void Window::SetBounds(const gfx::Rect& bounds) {
|
||||
window_->SetBounds(bounds);
|
||||
}
|
||||
@@ -498,6 +502,7 @@ void Window::BuildPrototype(v8::Isolate* isolate,
|
||||
.SetMethod("isMinimized", &Window::IsMinimized)
|
||||
.SetMethod("setFullScreen", &Window::SetFullScreen)
|
||||
.SetMethod("isFullScreen", &Window::IsFullscreen)
|
||||
.SetMethod("setAspectRatio", &Window::SetAspectRatio)
|
||||
.SetMethod("getBounds", &Window::GetBounds)
|
||||
.SetMethod("setBounds", &Window::SetBounds)
|
||||
.SetMethod("getSize", &Window::GetSize)
|
||||
|
||||
@@ -95,6 +95,7 @@ class Window : public mate::TrackableObject<Window>,
|
||||
bool IsMinimized();
|
||||
void SetFullScreen(bool fullscreen);
|
||||
bool IsFullscreen();
|
||||
void SetAspectRatio(double aspectRatio, gfx::Size extraSize);
|
||||
void SetBounds(const gfx::Rect& bounds);
|
||||
gfx::Rect GetBounds();
|
||||
void SetSize(int width, int height);
|
||||
|
||||
Reference in New Issue
Block a user