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

Unified Diff: ui/gfx/size_f.h

Issue 11377068: ui: Make gfx::Size::Scale() mutate the class. Add gfx::ScaleSize() similar to Rect/Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaseTOGO Created 8 years, 1 month 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
« no previous file with comments | « ui/gfx/size.h ('k') | ui/gfx/size_f.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/size_f.h
diff --git a/ui/gfx/size_f.h b/ui/gfx/size_f.h
index f9ac6bd890e5b5ab7ec4e7d4c880a5c7f4fef84b..45805019ba12ca7fe94f164cc56ba79d8b6f41c7 100644
--- a/ui/gfx/size_f.h
+++ b/ui/gfx/size_f.h
@@ -19,12 +19,12 @@ class UI_EXPORT SizeF : public SizeBase<SizeF, float> {
SizeF(float width, float height);
~SizeF();
- SizeF Scale(float scale) const WARN_UNUSED_RESULT {
- return Scale(scale, scale);
+ void Scale(float scale) {
+ Scale(scale, scale);
}
- SizeF Scale(float x_scale, float y_scale) const WARN_UNUSED_RESULT {
- return SizeF(width() * x_scale, height() * y_scale);
+ void Scale(float x_scale, float y_scale) {
+ SetSize(width() * x_scale, height() * y_scale);
}
std::string ToString() const;
@@ -38,6 +38,12 @@ inline bool operator!=(const SizeF& lhs, const SizeF& rhs) {
return !(lhs == rhs);
}
+UI_EXPORT SizeF ScaleSize(const SizeF& p, float x_scale, float y_scale);
+
+inline SizeF ScaleSize(const SizeF& p, float scale) {
+ return ScaleSize(p, scale, scale);
+}
+
#if !defined(COMPILER_MSVC)
extern template class SizeBase<SizeF, float>;
#endif
« no previous file with comments | « ui/gfx/size.h ('k') | ui/gfx/size_f.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698