Skip to content

Commit

Permalink
fix: max window size defaults to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Feb 21, 2022
1 parent 83a4ac1 commit b38d835
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions shell/browser/native_window.cc
Expand Up @@ -166,8 +166,9 @@ void NativeWindow::InitFromOptions(const gin_helper::Dictionary& options) {
options.Get(options::kMinWidth, &min_width);
options.Get(options::kMinHeight, &min_height);
size_constraints.set_minimum_size(gfx::Size(min_width, min_height));
int max_width = size_constraints.GetMaximumSize().width();
int max_height = size_constraints.GetMaximumSize().height();
gfx::Size max_size = size_constraints.GetMaximumSize();
int max_width = max_size.width() > 0 ? max_size.width() : INT_MAX;
int max_height = max_size.height() > 0 ? max_size.height() : INT_MAX;
options.Get(options::kMaxWidth, &max_width);
options.Get(options::kMaxHeight, &max_height);
size_constraints.set_maximum_size(gfx::Size(max_width, max_height));
Expand Down

0 comments on commit b38d835

Please sign in to comment.