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/point_f.h

Issue 11369144: ui: Make gfx::Point::Scale() mutate the class, similar to gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for aura 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
« cc/layer_impl.cc ('K') | « ui/gfx/point.h ('k') | ui/gfx/point_f.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/point_f.h
diff --git a/ui/gfx/point_f.h b/ui/gfx/point_f.h
index 3e69bd7eab205a7702b07228e15692a54f0b62cb..d9fa4498b12aea6ca9c9f40bbcf2d7ac7fe009e7 100644
--- a/ui/gfx/point_f.h
+++ b/ui/gfx/point_f.h
@@ -20,12 +20,12 @@ class UI_EXPORT PointF : public PointBase<PointF, float, Vector2dF> {
PointF(float x, float y);
~PointF();
- PointF Scale(float scale) const WARN_UNUSED_RESULT {
- return Scale(scale, scale);
+ void Scale(float scale) {
+ Scale(scale, scale);
}
- PointF Scale(float x_scale, float y_scale) const WARN_UNUSED_RESULT {
- return PointF(x() * x_scale, y() * y_scale);
+ void Scale(float x_scale, float y_scale) {
+ SetPoint(x() * x_scale, y() * y_scale);
}
// Returns a string representation of point.
@@ -56,6 +56,12 @@ inline PointF PointAtOffsetFromOrigin(const Vector2dF& offset_from_origin) {
return PointF(offset_from_origin.x(), offset_from_origin.y());
}
+UI_EXPORT PointF ScalePoint(const PointF& p, float x_scale, float y_scale);
+
+inline PointF ScalePoint(const PointF& p, float scale) {
+ return ScalePoint(p, scale, scale);
+}
+
#if !defined(COMPILER_MSVC)
extern template class PointBase<PointF, float, Vector2dF>;
#endif
« cc/layer_impl.cc ('K') | « ui/gfx/point.h ('k') | ui/gfx/point_f.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698