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

Unified Diff: chrome/browser/drag_utils.cc

Issue 7344: Convert GetPreferredSize from:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 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/drag_utils.cc
===================================================================
--- chrome/browser/drag_utils.cc (revision 3391)
+++ chrome/browser/drag_utils.cc (working copy)
@@ -149,14 +149,14 @@
} else {
button.SetIcon(icon);
}
- CSize pref;
- button.GetPreferredSize(&pref);
- button.SetBounds(0, 0, pref.cx, pref.cy);
+ gfx::Size prefsize = button.GetPreferredSize();
+ button.SetBounds(gfx::Point(), prefsize);
// Render the image.
- ChromeCanvas canvas(pref.cx, pref.cy, false);
+ ChromeCanvas canvas(prefsize.width(), prefsize.height(), false);
Elliot Glaysher 2008/10/15 17:21:46 Can ChromeCanvas take a gfx::Size?
Ben Goodger (Google) 2008/10/15 17:37:32 I looked at the users of Canvas. Most of them aren
button.Paint(&canvas, true);
- SetDragImageOnDataObject(canvas, pref.cx, pref.cy, pref.cx / 2, pref.cy / 2,
+ SetDragImageOnDataObject(canvas, prefsize.width(), prefsize.height(),
+ prefsize.width() / 2, prefsize.height() / 2,
data);
}

Powered by Google App Engine
This is Rietveld 408576698