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

Unified Diff: ash/touch/touch_hud_projection.cc

Issue 19271002: Fix projection touch HUD in RTL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/touch/touch_hud_projection.cc
diff --git a/ash/touch/touch_hud_projection.cc b/ash/touch/touch_hud_projection.cc
index 3a834a57eceb6f0598d706021e11be7f8ec4b75a..73041306712995defde34e8a2922923ee9698d40 100644
--- a/ash/touch/touch_hud_projection.cc
+++ b/ash/touch/touch_hud_projection.cc
@@ -35,7 +35,8 @@ class TouchPointView : public views::View,
explicit TouchPointView(views::Widget* parent_widget)
: circle_center_(kPointRadius + 1, kPointRadius + 1),
gradient_center_(SkPoint::Make(kPointRadius + 1,
- kPointRadius + 1)) {
+ kPointRadius + 1)),
+ parent_(parent_widget->GetContentsView()) {
SetPaintToLayer(true);
SetFillsBoundsOpaquely(false);
@@ -50,7 +51,7 @@ class TouchPointView : public views::View,
gradient_pos_[0] = SkFloatToScalar(0.9f);
gradient_pos_[1] = SkFloatToScalar(1.0f);
- parent_widget->GetContentsView()->AddChildView(this);
+ parent_->AddChildView(this);
parent_widget->AddObserver(this);
}
@@ -63,8 +64,11 @@ class TouchPointView : public views::View,
this));
fadeout_->Start();
} else {
- SetX(touch.root_location().x() - kPointRadius - 1);
sadrul 2013/07/15 21:44:06 Can you use: SetX(parent()->GetMirroredXInView(t
mohsen 2013/07/15 22:10:52 Yes, much better. Done.
- SetY(touch.root_location().y() - kPointRadius - 1);
+ gfx::Point position(touch.root_location().x() - kPointRadius - 1,
+ touch.root_location().y() - kPointRadius - 1);
+ if (base::i18n::IsRTL())
+ position.set_x(parent_->width() - position.x() - width());
+ SetPosition(position);
}
}
@@ -124,6 +128,8 @@ class TouchPointView : public views::View,
const gfx::Point circle_center_;
const SkPoint gradient_center_;
+ View* parent_;
+
SkPaint fill_paint_;
SkPaint stroke_paint_;
SkColor gradient_colors_[2];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698