Chromium Code Reviews| Index: ash/display/multi_display_manager.cc |
| diff --git a/ash/display/multi_display_manager.cc b/ash/display/multi_display_manager.cc |
| index 3fc4ea54d82bbed9aef7a6dc5110c75ea4741826..fd7252fcb54a1bbf202d83ca1c4031f2651fd3fa 100644 |
| --- a/ash/display/multi_display_manager.cc |
| +++ b/ash/display/multi_display_manager.cc |
| @@ -514,11 +514,11 @@ void MultiDisplayManager::EnsurePointerInDisplays() { |
| break; |
| } |
| gfx::Point center = display_bounds.CenterPoint(); |
| - gfx::Point diff = center.Subtract(location_in_screen); |
| + gfx::Vector2d diff = center.Subtract(location_in_screen); |
|
Peter Kasting
2012/10/27 01:01:39
Nit: Inline into next statement
danakj
2012/10/29 19:17:20
Done.
|
| // Use the distance from the center of the dislay. This is not |
| // exactly "closest" display, but good enough to pick one |
| // appropriate (and there are at most two displays). |
| - int64 distance = diff.x() * diff.x() + diff.y() * diff.y(); |
|
danakj
2012/10/27 00:35:33
Was able to make use of LengthSquared() here.
|
| + int64 distance = diff.LengthSquared(); |
| if (closest_distance < 0 || closest_distance > distance) { |
| target_location = center; |
| closest_distance = distance; |