Merge pull request #2250 from EyeSee360/master

Maintain an aspect ratio for content within a window
This commit is contained in:
Cheng Zhao 2015-07-23 09:45:42 +08:00
commit ea1b89c699
6 changed files with 66 additions and 0 deletions

View file

@ -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)

View file

@ -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);