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

Unified Diff: ash/drag_drop/drag_drop_controller.cc

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-gfx: . Created 5 years, 3 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/drag_drop/drag_drop_controller.cc
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index cf69a9c63b1c89ea9bd221ef5c803b7205b48918..ba8afe4524b5a4160e9ead700da716146d6c981a 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -51,8 +51,8 @@ gfx::Rect AdjustDragImageBoundsForScaleAndOffset(
int vertical_offset,
float scale,
gfx::Vector2d* drag_image_offset) {
- gfx::PointF final_origin = drag_image_bounds.origin();
- gfx::SizeF final_size = gfx::SizeF(drag_image_bounds.size());
+ auto final_origin = gfx::PointF(drag_image_bounds.origin());
+ auto final_size = gfx::SizeF(drag_image_bounds.size());
final_size.Scale(scale);
drag_image_offset->set_x(drag_image_offset->x() * scale);
drag_image_offset->set_y(drag_image_offset->y() * scale);
@@ -263,10 +263,8 @@ void DragDropController::DragUpdate(aura::Window* target,
aura::client::DragDropDelegate* delegate =
aura::client::GetDragDropDelegate(drag_window_);
if (delegate) {
- ui::DropTargetEvent e(*drag_data_,
- event.location(),
- event.root_location(),
- drag_operation_);
+ ui::DropTargetEvent e(*drag_data_, event.location_f(),
+ event.root_location_f(), drag_operation_);
e.set_flags(event.flags());
delegate->OnDragEntered(e);
}
@@ -274,10 +272,8 @@ void DragDropController::DragUpdate(aura::Window* target,
aura::client::DragDropDelegate* delegate =
aura::client::GetDragDropDelegate(drag_window_);
if (delegate) {
- ui::DropTargetEvent e(*drag_data_,
- event.location(),
- event.root_location(),
- drag_operation_);
+ ui::DropTargetEvent e(*drag_data_, event.location_f(),
+ event.root_location_f(), drag_operation_);
e.set_flags(event.flags());
op = delegate->OnDragUpdated(e);
gfx::NativeCursor cursor = ui::kCursorNoDrop;
@@ -316,8 +312,8 @@ void DragDropController::Drop(aura::Window* target,
aura::client::DragDropDelegate* delegate =
aura::client::GetDragDropDelegate(target);
if (delegate) {
- ui::DropTargetEvent e(
- *drag_data_, event.location(), event.root_location(), drag_operation_);
+ ui::DropTargetEvent e(*drag_data_, event.location_f(),
+ event.root_location_f(), drag_operation_);
e.set_flags(event.flags());
drag_operation_ = delegate->OnPerformDrop(e);
if (drag_operation_ == 0)
@@ -420,8 +416,8 @@ void DragDropController::OnGestureEvent(ui::GestureEvent* event) {
ui::GestureEvent touch_offset_event(*event,
static_cast<aura::Window*>(NULL),
static_cast<aura::Window*>(NULL));
- gfx::Point touch_offset_location = touch_offset_event.location();
- gfx::Point touch_offset_root_location = touch_offset_event.root_location();
+ gfx::PointF touch_offset_location = touch_offset_event.location_f();
+ gfx::PointF touch_offset_root_location = touch_offset_event.root_location_f();
touch_offset_location.Offset(0, kTouchDragImageVerticalOffset);
touch_offset_root_location.Offset(0, kTouchDragImageVerticalOffset);
touch_offset_event.set_location(touch_offset_location);

Powered by Google App Engine
This is Rietveld 408576698