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

Unified Diff: trunk/src/ash/wm/window_util.cc

Issue 131543006: Revert 243986 "Fix AdjustBoundsToEnsureWindowVisibility to work ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 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 | « trunk/src/ash/wm/system_gesture_event_filter_unittest.cc ('k') | trunk/src/ash/wm/window_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ash/wm/window_util.cc
===================================================================
--- trunk/src/ash/wm/window_util.cc (revision 244019)
+++ trunk/src/ash/wm/window_util.cc (working copy)
@@ -94,18 +94,18 @@
min_width = std::min(min_width, visible_area.width());
min_height = std::min(min_height, visible_area.height());
- if (bounds->right() < visible_area.x() + min_width) {
- bounds->set_x(visible_area.x() + min_width - bounds->width());
- } else if (bounds->x() > visible_area.right() - min_width) {
+ if (bounds->x() + min_width > visible_area.right()) {
bounds->set_x(visible_area.right() - min_width);
+ } else if (bounds->right() - min_width < 0) {
+ bounds->set_x(min_width - bounds->width());
}
- if (bounds->bottom() < visible_area.y() + min_height) {
- bounds->set_y(visible_area.y() + min_height - bounds->height());
- } else if (bounds->y() > visible_area.bottom() - min_height) {
+ if (bounds->y() + min_height > visible_area.bottom()) {
bounds->set_y(visible_area.bottom() - min_height);
+ } else if (bounds->bottom() - min_height < 0) {
+ bounds->set_y(min_height - bounds->height());
}
- if (bounds->y() < visible_area.y())
- bounds->set_y(visible_area.y());
+ if (bounds->y() < 0)
+ bounds->set_y(0);
}
bool MoveWindowToEventRoot(aura::Window* window, const ui::Event& event) {
« no previous file with comments | « trunk/src/ash/wm/system_gesture_event_filter_unittest.cc ('k') | trunk/src/ash/wm/window_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698