Index: ui/views/win/hwnd_message_handler.cc |
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc |
index 744b9eaddbc86a767316af0ed032e9b54c89fb33..1544507ef39740982de458fcff8f71dd0b069b6c 100644 |
--- a/ui/views/win/hwnd_message_handler.cc |
+++ b/ui/views/win/hwnd_message_handler.cc |
@@ -1431,10 +1431,11 @@ void HWNDMessageHandler::OnGetMinMaxInfo(MINMAXINFO* minmax_info) { |
CR_DEFLATE_RECT(&window_rect, &client_rect); |
min_window_size.Enlarge(window_rect.right - window_rect.left, |
window_rect.bottom - window_rect.top); |
- if (!max_window_size.IsEmpty()) { |
- max_window_size.Enlarge(window_rect.right - window_rect.left, |
- window_rect.bottom - window_rect.top); |
- } |
+ // Either axis may be zero, so enlarge them independently. |
+ if (max_window_size.width()) |
+ max_window_size.Enlarge(window_rect.right - window_rect.left, 0); |
+ if (max_window_size.height()) |
+ max_window_size.Enlarge(0, window_rect.bottom - window_rect.top); |
} |
minmax_info->ptMinTrackSize.x = min_window_size.width(); |
minmax_info->ptMinTrackSize.y = min_window_size.height(); |