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

Unified Diff: ui/app_list/apps_grid_view.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RenderText fixup Created 8 years, 2 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/app_list/apps_grid_view.cc
diff --git a/ui/app_list/apps_grid_view.cc b/ui/app_list/apps_grid_view.cc
index f9e21c96027d73af0f511d6ce93310034b9d87f4..08ab470a1e3e258be890a1cf167cb8908b0091bb 100644
--- a/ui/app_list/apps_grid_view.cc
+++ b/ui/app_list/apps_grid_view.cc
@@ -169,15 +169,14 @@ void AppsGridView::InitiateDrag(views::View* view,
return;
drag_view_ = view;
- drag_offset_ = event.location();
+ drag_start_ = event.location();
}
void AppsGridView::UpdateDrag(views::View* view,
Pointer pointer,
const ui::LocatedEvent& event) {
if (!dragging() && drag_view_ &&
- ExceededDragThreshold(event.x() - drag_offset_.x(),
- event.y() - drag_offset_.y())) {
+ ExceededDragThreshold(event.location() - drag_start_)) {
drag_pointer_ = pointer;
// Move the view to the front so that it appears on top of other views.
ReorderChildView(drag_view_, -1);
@@ -198,7 +197,8 @@ void AppsGridView::UpdateDrag(views::View* view,
if (last_drop_target != drop_target_)
AnimateToIdealBounds();
- drag_view_->SetPosition(last_drag_point_.Subtract(drag_offset_));
+ drag_view_->SetPosition(
+ gfx::PointAtOffsetFromOrigin(last_drag_point_ - drag_start_));
}
}

Powered by Google App Engine
This is Rietveld 408576698