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

Unified Diff: ui/views/controls/link.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 8 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
Index: ui/views/controls/link.cc
diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc
index 84ff1de5eebdbb317658fb15fd62b16ba14b6c00..a663ccb45657c524656e5ba717059f48080c91fd 100644
--- a/ui/views/controls/link.cc
+++ b/ui/views/controls/link.cc
@@ -68,7 +68,7 @@ bool Link::OnMousePressed(const ui::MouseEvent& event) {
bool Link::OnMouseDragged(const ui::MouseEvent& event) {
SetPressed(enabled() &&
(event.IsLeftMouseButton() || event.IsMiddleMouseButton()) &&
- HitTestPoint(event.location()));
+ HitTestPoint(gfx::ToFlooredPoint(event.location())));
return true;
}
@@ -76,9 +76,8 @@ void Link::OnMouseReleased(const ui::MouseEvent& event) {
// Change the highlight first just in case this instance is deleted
// while calling the controller
OnMouseCaptureLost();
- if (enabled() &&
- (event.IsLeftMouseButton() || event.IsMiddleMouseButton()) &&
- HitTestPoint(event.location())) {
+ if (enabled() && (event.IsLeftMouseButton() || event.IsMiddleMouseButton()) &&
+ HitTestPoint(gfx::ToFlooredPoint(event.location()))) {
// Focus the link on click.
RequestFocus();

Powered by Google App Engine
This is Rietveld 408576698