Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 1139043004: [Android] Round instead if truncate for selection coordinates (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index ad0ed2ce7ef3fad021db30f176c27d2b56243d96..3e88accc662db8ad1f6f54bf6915cb393f38a35b 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -53,6 +53,7 @@
#include "ui/android/view_android.h"
#include "ui/android/window_android.h"
#include "ui/gfx/android/java_bitmap.h"
+#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/geometry/size_f.h"
#include "ui/gfx/screen.h"
@@ -799,7 +800,7 @@ void ContentViewCoreImpl::MoveRangeSelectionExtent(const gfx::PointF& extent) {
if (!web_contents_)
return;
- web_contents_->MoveRangeSelectionExtent(gfx::Point(extent.x(), extent.y()));
+ web_contents_->MoveRangeSelectionExtent(gfx::ToRoundedPoint(extent));
}
void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& base,
@@ -807,8 +808,8 @@ void ContentViewCoreImpl::SelectBetweenCoordinates(const gfx::PointF& base,
if (!web_contents_)
return;
- gfx::Point base_point = gfx::Point(base.x(), base.y());
- gfx::Point extent_point = gfx::Point(extent.x(), extent.y());
+ gfx::Point base_point = gfx::ToRoundedPoint(base);
+ gfx::Point extent_point = gfx::ToRoundedPoint(extent);
if (base_point == extent_point)
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698