add function maintainAspectRatioOfInteriorContent to BrowserWindow in order to enforce an aspect ratio for an electron window

This commit is contained in:
Michael S. Barthelemy 2015-07-16 13:54:51 -04:00
parent ca2cb9c9ba
commit 666aca7803
5 changed files with 53 additions and 0 deletions

View file

@ -249,6 +249,10 @@ bool Window::IsFullscreen() {
return window_->IsFullscreen();
}
void Window::MaintainAspectRatioOfInteriorContent(double aspectRatio, double extraWidth, double extraHeight) {
window_->MaintainAspectRatioOfInteriorContent(aspectRatio, gfx::Size(extraWidth, extraHeight));
}
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("maintainAspectRatioOfInteriorContent", &Window::MaintainAspectRatioOfInteriorContent)
.SetMethod("getBounds", &Window::GetBounds)
.SetMethod("setBounds", &Window::SetBounds)
.SetMethod("getSize", &Window::GetSize)