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

Unified Diff: ui/views/view.cc

Issue 10081037: views: Fix painting views with layers in RTL locale. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test Created 8 years, 8 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') | ui/views/view_unittest.cc » ('J')
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 0ebe61794af8f9ff008b98508ae8ade0ab26b25e..c98fa04eda92f42c81f74efbee0c8975c46645bf 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -1179,7 +1179,7 @@ void View::CalculateOffsetToAncestorWithLayer(gfx::Point* offset,
if (!parent_)
return;
- offset->Offset(x(), y());
+ offset->Offset(GetMirroredX(), y());
parent_->CalculateOffsetToAncestorWithLayer(offset, layer_parent);
}
@@ -1187,7 +1187,7 @@ void View::MoveLayerToParent(ui::Layer* parent_layer,
const gfx::Point& point) {
gfx::Point local_point(point);
if (parent_layer != layer())
- local_point.Offset(x(), y());
+ local_point.Offset(GetMirroredX(), y());
if (layer() && parent_layer != layer()) {
parent_layer->Add(layer());
layer()->SetBounds(gfx::Rect(local_point.x(), local_point.y(),
@@ -1222,7 +1222,7 @@ void View::UpdateChildLayerBounds(const gfx::Point& offset) {
layer()->SetBounds(gfx::Rect(offset.x(), offset.y(), width(), height()));
} else {
for (int i = 0, count = child_count(); i < count; ++i) {
- gfx::Point new_offset(offset.x() + child_at(i)->x(),
+ gfx::Point new_offset(offset.x() + child_at(i)->GetMirroredX(),
offset.y() + child_at(i)->y());
child_at(i)->UpdateChildLayerBounds(new_offset);
}
@@ -1637,7 +1637,7 @@ void View::BoundsChanged(const gfx::Rect& previous_bounds) {
if (parent_) {
gfx::Point offset;
parent_->CalculateOffsetToAncestorWithLayer(&offset, NULL);
- offset.Offset(x(), y());
+ offset.Offset(GetMirroredX(), y());
layer()->SetBounds(gfx::Rect(offset, size()));
} else {
layer()->SetBounds(bounds_);
@@ -1809,7 +1809,7 @@ void View::UpdateParentLayer() {
return;
ui::Layer* parent_layer = NULL;
- gfx::Point offset(x(), y());
+ gfx::Point offset(GetMirroredX(), y());
// TODO(sad): The NULL check here for parent_ essentially is to check if this
// is the RootView. Instead of doing this, this function should be made
« no previous file with comments | « no previous file | ui/views/view_unittest.cc » ('j') | ui/views/view_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698