From: Cheng Zhao Date: Thu, 26 Mar 2015 04:23:38 +0000 (+0800) Subject: Enable setting only one side of max/min size, fixes #1301 X-Git-Tag: v0.22.3~26 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ae5586408f0cc5ff630563c4b42a53771d4ce49f;p=electron.git Enable setting only one side of max/min size, fixes #1301 --- diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index df36bfa8..b01c9a4d 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -204,8 +204,8 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) { options.Get(switches::kMinWidth, &min_width)) { SetMinimumSize(gfx::Size(min_width, min_height)); } - int max_height = -1, max_width = -1; - if (options.Get(switches::kMaxHeight, &max_height) && + int max_height = INT_MAX, max_width = INT_MAX; + if (options.Get(switches::kMaxHeight, &max_height) | options.Get(switches::kMaxWidth, &max_width)) { SetMaximumSize(gfx::Size(max_width, max_height)); }