Index: ui/views/view.cc |
diff --git a/ui/views/view.cc b/ui/views/view.cc |
index fd1ac7f79ab0fc023a3c2827f1b4eaa880f4fa30..315dd1c8f76df2d9c20d4e118f98f731df68ce1b 100644 |
--- a/ui/views/view.cc |
+++ b/ui/views/view.cc |
@@ -623,7 +623,7 @@ void View::ConvertPointToTarget(const View* source, |
// API defines NULL |source| as returning the point in screen coordinates. |
if (!source) { |
*point = point->Subtract( |
- root->GetWidget()->GetClientAreaBoundsInScreen().origin()); |
+ root->GetWidget()->GetClientAreaBoundsInScreen().OffsetFromOrigin()); |
} |
} |
@@ -652,8 +652,7 @@ void View::ConvertPointToScreen(const View* src, gfx::Point* p) { |
const Widget* widget = src->GetWidget(); |
if (widget) { |
ConvertPointToWidget(src, p); |
- gfx::Rect r = widget->GetClientAreaBoundsInScreen(); |
- p->SetPoint(p->x() + r.x(), p->y() + r.y()); |
+ *p = p->Add(widget->GetClientAreaBoundsInScreen().OffsetFromOrigin()); |
} |
} |
@@ -665,15 +664,14 @@ void View::ConvertPointFromScreen(const View* dst, gfx::Point* p) { |
const views::Widget* widget = dst->GetWidget(); |
if (!widget) |
return; |
- const gfx::Rect r = widget->GetClientAreaBoundsInScreen(); |
- p->Offset(-r.x(), -r.y()); |
+ *p = p->Add(-widget->GetClientAreaBoundsInScreen().OffsetFromOrigin()); |
views::View::ConvertPointFromWidget(dst, p); |
} |
gfx::Rect View::ConvertRectToParent(const gfx::Rect& rect) const { |
gfx::Rect x_rect = rect; |
GetTransform().TransformRect(&x_rect); |
- x_rect.Offset(GetMirroredPosition()); |
+ x_rect.Offset(GetMirroredPosition().OffsetFromOrigin()); |
return x_rect; |
} |
@@ -724,7 +722,7 @@ void View::Paint(gfx::Canvas* canvas) { |
// Non-empty clip, translate the graphics such that 0,0 corresponds to |
// where this view is located (related to its parent). |
- canvas->Translate(GetMirroredPosition()); |
+ canvas->Translate(GetMirroredPosition().OffsetFromOrigin()); |
canvas->Transform(GetTransform()); |
PaintCommon(canvas); |
@@ -1526,7 +1524,7 @@ void View::PaintCommon(gfx::Canvas* canvas) { |
// request the canvas to be flipped. |
ScopedCanvas scoped(canvas); |
if (FlipCanvasOnPaintForRTLUI()) { |
- canvas->Translate(gfx::Point(width(), 0)); |
+ canvas->Translate(gfx::Vector2d(width(), 0)); |
canvas->Scale(-1, 1); |
} |