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

Unified Diff: ui/views/view.cc

Issue 819273003: View: Resizing a layer in RTL now correctly repositions its children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify logic; separate and expand tests. Created 5 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 | « no previous file | ui/views/view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 7bf2ee68bc5512afdb7cb7ecbedbbf1fe6b0de2a..bcbba9c52b76ad8c668df7094fa19e2f372cee08 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -1916,6 +1916,17 @@ void View::BoundsChanged(const gfx::Rect& previous_bounds) {
} else {
SetLayerBounds(bounds_);
}
+
+ // In RTL mode, if our width has changed, our children's mirrored bounds
+ // will have changed. Update the child's layer bounds, or if it is not a
+ // layer, the bounds of any layers inside the child.
+ if (base::i18n::IsRTL() && bounds_.width() != previous_bounds.width()) {
+ for (int i = 0; i < child_count(); ++i) {
+ View* child = child_at(i);
+ child->UpdateChildLayerBounds(
+ gfx::Vector2d(child->GetMirroredX(), child->y()));
+ }
+ }
} else {
// If our bounds have changed, then any descendant layer bounds may have
// changed. Update them accordingly.
« no previous file with comments | « no previous file | ui/views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698