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

Unified Diff: ash/frame/caption_buttons/alternate_frame_size_button.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: ash/frame/caption_buttons/alternate_frame_size_button.cc
diff --git a/ash/frame/caption_buttons/alternate_frame_size_button.cc b/ash/frame/caption_buttons/alternate_frame_size_button.cc
index 54799cb134f82e62d9b5458a3ea98776149d120e..f3303ab8ebd9b58f5e0981315b3b1564270650c9 100644
--- a/ash/frame/caption_buttons/alternate_frame_size_button.cc
+++ b/ash/frame/caption_buttons/alternate_frame_size_button.cc
@@ -137,7 +137,8 @@ void AlternateFrameSizeButton::OnGestureEvent(ui::GestureEvent* event) {
void AlternateFrameSizeButton::StartSetButtonsToSnapModeTimer(
const ui::LocatedEvent& event) {
- set_buttons_to_snap_mode_timer_event_location_ = event.location();
+ set_buttons_to_snap_mode_timer_event_location_ =
+ gfx::ToFlooredPoint(event.location());
if (set_buttons_to_snap_mode_delay_ms_ == 0) {
AnimateButtonsToSnapMode();
} else {
@@ -177,8 +178,8 @@ void AlternateFrameSizeButton::UpdateSnapType(const ui::LocatedEvent& event) {
// |set_buttons_to_snap_mode_timer_| is checked to avoid entering the snap
// mode as a result of an unsupported drag type (e.g. only the right mouse
// button is pressed).
- gfx::Vector2d delta(
- event.location() - set_buttons_to_snap_mode_timer_event_location_);
+ gfx::Vector2d delta(gfx::ToFlooredPoint(event.location()) -
+ set_buttons_to_snap_mode_timer_event_location_);
if (!set_buttons_to_snap_mode_timer_.IsRunning() ||
!views::View::ExceededDragThreshold(delta)) {
return;
@@ -186,7 +187,7 @@ void AlternateFrameSizeButton::UpdateSnapType(const ui::LocatedEvent& event) {
AnimateButtonsToSnapMode();
}
- gfx::Point event_location_in_screen(event.location());
+ gfx::Point event_location_in_screen(gfx::ToFlooredPoint(event.location()));
views::View::ConvertPointToScreen(this, &event_location_in_screen);
const FrameCaptionButton* to_hover =
GetButtonToHover(event_location_in_screen);

Powered by Google App Engine
This is Rietveld 408576698