From: Cheng Zhao Date: Tue, 19 Aug 2014 13:43:18 +0000 (+0800) Subject: Enable setting only one side of minimum size, fixes #461. X-Git-Tag: v0.16.0~17^2~4 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=7b71ae6824f509bca0535c391b5f43867c0eb1d8;p=electron.git Enable setting only one side of minimum size, fixes #461. --- diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index d3930012..0ec5f218 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -141,8 +141,8 @@ void NativeWindow::InitFromOptions(const mate::Dictionary& options) { } else if (options.Get(switches::kCenter, ¢er) && center) { Center(); } - int min_height = -1, min_width = -1; - if (options.Get(switches::kMinHeight, &min_height) && + int min_height = 0, min_width = 0; + if (options.Get(switches::kMinHeight, &min_height) || options.Get(switches::kMinWidth, &min_width)) { SetMinimumSize(gfx::Size(min_width, min_height)); }