]> khamidou — GitHub mirrors - electron.git/commitdiff
Enable setting only one side of max/min size, fixes #1301
authorCheng Zhao <zcbenz@gmail.com>
Thu, 26 Mar 2015 04:23:38 +0000 (12:23 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 26 Mar 2015 04:23:38 +0000 (12:23 +0800)
atom/browser/native_window.cc

index df36bfa8570a30dcc5b4b45ffc16e9aa6e9bd1a8..b01c9a4d4ed1a42183753c56049c6bb40e6f2d2a 100644 (file)
@@ -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));
   }