Index: ash/display/multi_display_manager.cc |
diff --git a/ash/display/multi_display_manager.cc b/ash/display/multi_display_manager.cc |
index d93321b3e1f26549895bc0f222aa3048ed403eb4..a81bf04069beb902a714eda0cf0267db073ad54e 100644 |
--- a/ash/display/multi_display_manager.cc |
+++ b/ash/display/multi_display_manager.cc |
@@ -523,11 +523,10 @@ void MultiDisplayManager::EnsurePointerInDisplays() { |
break; |
} |
gfx::Point center = display_bounds.CenterPoint(); |
- gfx::Point diff = center.Subtract(location_in_screen); |
// 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(); |
+ int64 distance = (center - location_in_screen).LengthSquared(); |
Peter Kasting
2012/10/29 23:06:33
Nit: Rename |distance_squared| (and maybe also |cl
danakj
2012/10/29 23:21:41
Done.
|
if (closest_distance < 0 || closest_distance > distance) { |
target_location = center; |
closest_distance = distance; |