Index: chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc |
diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc |
index bfb1a1077c92547e238b5ebe0650344dd1b2c3cf..c08be1f0a0c70fc4c3de982cd0e7cbf0795d1958 100644 |
--- a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc |
+++ b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.cc |
@@ -507,7 +507,9 @@ gfx::Point DraggedTabControllerGtk::ConvertScreenPointToTabStripPoint( |
TabStripGtk* tabstrip, const gfx::Point& screen_point) { |
gfx::Point tabstrip_screen_point = |
ui::GetWidgetScreenPosition(tabstrip->tabstrip_.get()); |
- return screen_point.Subtract(tabstrip_screen_point); |
+ gfx::Vector2d tabstrip_offset = |
sky
2012/10/26 21:37:50
This results in a lot harder to read code.
Peter Kasting
2012/10/26 21:50:12
I agree, but not because of Vector2d, just because
danakj
2012/10/26 21:59:43
I'll look into that, thanks.
There's probably a f
danakj
2012/10/26 23:30:34
This certainly does clean up things, such as Conve
|
+ screen_point.DistanceFrom(tabstrip_screen_point); |
+ return gfx::PointAtDistanceFromOrigin(tabstrip_offset); |
} |
gfx::Rect DraggedTabControllerGtk::GetDraggedViewTabStripBounds( |
@@ -818,7 +820,7 @@ gfx::Rect DraggedTabControllerGtk::GetAnimateBounds() { |
GtkWidget* widget = tab->widget(); |
GtkWidget* parent = gtk_widget_get_parent(widget); |
gfx::Point point = ui::GetWidgetScreenPosition(parent); |
- bounds.Offset(point); |
+ bounds.Offset(point.DistanceFromOrigin()); |
return gfx::Rect(bounds.x(), bounds.y(), |
dragged_view_->GetTotalWidthInTabStrip(), bounds.height()); |