Chromium Code Reviews| Index: ui/aura/window.cc |
| diff --git a/ui/aura/window.cc b/ui/aura/window.cc |
| index 83a532b0524371c09cd0bb47625a93eedcd6e9f9..073504ab8272d1da0077fcb9f0f92c89ac97e33f 100644 |
| --- a/ui/aura/window.cc |
| +++ b/ui/aura/window.cc |
| @@ -432,22 +432,34 @@ const Window* Window::GetChildById(int id) const { |
| void Window::ConvertPointToTarget(const Window* source, |
| const Window* target, |
| gfx::Point* point) { |
| + gfx::PointF point_f(*point); |
| + ConvertPointToTargetF(source, target, &point_f); |
| + *point = gfx::ToFlooredPoint(point_f); |
| +} |
| + |
| +// static |
| +void Window::ConvertPointToTargetF(const Window* source, |
| + const Window* target, |
| + gfx::PointF* point) { |
| if (!source) |
| return; |
| if (source->GetRootWindow() != target->GetRootWindow()) { |
| + gfx::Point floored = gfx::ToFlooredPoint(*point); |
|
tdresser
2017/01/20 16:07:48
Do we need to floor in this case?
denniskempin
2017/01/20 18:26:33
I am flooring here to be able to pass a Point into
|
| client::ScreenPositionClient* source_client = |
| client::GetScreenPositionClient(source->GetRootWindow()); |
| // |source_client| can be NULL in tests. |
| if (source_client) |
| - source_client->ConvertPointToScreen(source, point); |
| + source_client->ConvertPointToScreen(source, &floored); |
| client::ScreenPositionClient* target_client = |
| client::GetScreenPositionClient(target->GetRootWindow()); |
| // |target_client| can be NULL in tests. |
| if (target_client) |
| - target_client->ConvertPointFromScreen(target, point); |
| + target_client->ConvertPointFromScreen(target, &floored); |
| + |
| + *point = gfx::PointF(floored); |
| } else { |
| - ui::Layer::ConvertPointToLayer(source->layer(), target->layer(), point); |
| + ui::Layer::ConvertPointToLayerF(source->layer(), target->layer(), point); |
| } |
| } |