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

Unified Diff: ui/gfx/rect.cc

Issue 8477019: Adds Window::MoveChildToFront, with surrounding changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 9 years, 1 month 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 | « ui/gfx/compositor/layer.cc ('k') | views/widget/native_widget_aura.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/rect.cc
diff --git a/ui/gfx/rect.cc b/ui/gfx/rect.cc
index 81d4e095e7ca588dd238fc7708a01df16b3ff299..e0358c839739aafdc2ef0018c6c2f01ce9a64cbf 100644
--- a/ui/gfx/rect.cc
+++ b/ui/gfx/rect.cc
@@ -22,13 +22,11 @@
namespace {
void AdjustAlongAxis(int dst_origin, int dst_size, int* origin, int* size) {
- if (*origin < dst_origin) {
+ *size = std::min(dst_size, *size);
+ if (*origin < dst_origin)
*origin = dst_origin;
- *size = std::min(dst_size, *size);
- } else {
- *size = std::min(dst_size, *size);
+ else
*origin = std::min(dst_origin + dst_size, *origin + *size) - *size;
- }
}
} // namespace
« no previous file with comments | « ui/gfx/compositor/layer.cc ('k') | views/widget/native_widget_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698