Index: ui/views/view.cc |
diff --git a/ui/views/view.cc b/ui/views/view.cc |
index 7bf2ee68bc5512afdb7cb7ecbedbbf1fe6b0de2a..f8477959242a7fb47f2b46669f61228769f19939 100644 |
--- a/ui/views/view.cc |
+++ b/ui/views/view.cc |
@@ -1894,7 +1894,7 @@ void View::VisibilityChangedImpl(View* starting_from, bool is_visible) { |
VisibilityChanged(starting_from, is_visible); |
} |
-void View::BoundsChanged(const gfx::Rect& previous_bounds) { |
+void View::MirroredBoundsChanged(const gfx::Rect& previous_bounds) { |
sky
2015/01/08 03:33:27
I'm still against a new method here. As previously
Matt Giuca
2015/01/08 04:22:15
Is this what you want?
I find this new version pr
sky
2015/01/08 22:05:02
What do you mean? UpdateChildLayerBounds handles t
Matt Giuca
2015/01/09 03:28:05
OK I see how you simplified it. I've verified that
|
// Mark our bounds as dirty for the paint root, also see if we need to |
// recompute our children's bounds due to origin change. |
bool origin_changed = |
@@ -1921,6 +1921,19 @@ void View::BoundsChanged(const gfx::Rect& previous_bounds) { |
// changed. Update them accordingly. |
UpdateChildLayerBounds(CalculateOffsetToAncestorWithLayer(NULL)); |
} |
+} |
+ |
+void View::BoundsChanged(const gfx::Rect& previous_bounds) { |
+ MirroredBoundsChanged(previous_bounds); |
+ |
+ // In RTL mode, if our width has changed, our children's mirrored bounds will |
+ // have changed. Notify them, so that they can update their layer bounds, etc. |
+ if (base::i18n::IsRTL() && bounds_.width() != previous_bounds.width()) { |
+ for (int i = 0; i < child_count(); ++i) { |
+ View* child = child_at(i); |
+ child->MirroredBoundsChanged(child->bounds()); |
+ } |
+ } |
OnBoundsChanged(previous_bounds); |