Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(188)

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 656723002: [Win] Update HWND max size if either width or height is set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698