Chromium Code Reviews| 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]; |