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

Unified Diff: chrome/browser/ui/gtk/tabs/tab_renderer_gtk.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: rebase 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: chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
index a785d9d3d505a8b8fd10305b0d277614afc7afc3..a10b0fdcc359068d3336ef485c603c9c8d366bb6 100644
--- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
+++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc
@@ -93,14 +93,14 @@ const int kCloseButtonHorzFuzz = 4;
// Gets the bounds of |widget| relative to |parent|.
gfx::Rect GetWidgetBoundsRelativeToParent(GtkWidget* parent,
GtkWidget* widget) {
- gfx::Point parent_pos = ui::GetWidgetScreenPosition(parent);
- gfx::Point widget_pos = ui::GetWidgetScreenPosition(widget);
+ gfx::Vector2d parent_offset = ui::GetWidgetScreenOffset(parent);
+ gfx::Vector2d widget_offset = ui::GetWidgetScreenOffset(widget);
+ gfx::Vector2d relative_offset = widget_offset - parent_offset;
GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation);
- return gfx::Rect(widget_pos.x() - parent_pos.x(),
- widget_pos.y() - parent_pos.y(),
+ return gfx::Rect(relative_offset.x(), relative_offset.y(),
allocation.width, allocation.height);
}

Powered by Google App Engine
This is Rietveld 408576698