summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-10-21 17:24:55 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-22 00:25:44 +0000
commit34a8990806a42ee9356ce5b2f932057169c03a90 (patch)
tree51995c7a9fda5104ebdda107b7abfe66d3cef576 /ash
parentb4cc5afde6fbc116fc3806c16cab60bf06f215a4 (diff)
downloadchromium_src-34a8990806a42ee9356ce5b2f932057169c03a90.zip
chromium_src-34a8990806a42ee9356ce5b2f932057169c03a90.tar.gz
chromium_src-34a8990806a42ee9356ce5b2f932057169c03a90.tar.bz2
Remove some implicit Point to PointF conversions, add helpers.
This adds gfx::ScaleTo{Floored,Ceiled,Rounded}Point() helpers similar to those that exist for Rect and Size. It uses those helpers to scale integer points to integer points, and avoid implicit conversions to PointFs in the calling code. Also removes some implicit conversions to PointF with ui::SelectionBounds. R=sadrul, sky BUG=342848 Review URL: https://codereview.chromium.org/1417023002 Cr-Commit-Position: refs/heads/master@{#355451}
Diffstat (limited to 'ash')
-rw-r--r--ash/touch/touch_uma.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/ash/touch/touch_uma.cc b/ash/touch/touch_uma.cc
index b314e2d..311fade 100644
--- a/ash/touch/touch_uma.cc
+++ b/ash/touch/touch_uma.cc
@@ -108,8 +108,8 @@ void TouchUMA::RecordTouchEvent(aura::Window* target,
// Prefer raw event location (when available) over calibrated location.
if (event.HasNativeEvent()) {
position = ui::EventLocationFromNative(event.native_event());
- position = gfx::ToFlooredPoint(
- gfx::ScalePoint(position, 1. / target->layer()->device_scale_factor()));
+ position = gfx::ScaleToFlooredPoint(
+ position, 1.f / target->layer()->device_scale_factor());
}
position.set_x(std::min(bounds.width() - 1, std::max(0, position.x())));