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

Unified Diff: ui/gfx/geometry/point.h

Issue 1417023002: Remove some implicit Point to PointF conversions, add helpers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-views: extrachange Created 5 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: ui/gfx/geometry/point.h
diff --git a/ui/gfx/geometry/point.h b/ui/gfx/geometry/point.h
index a1686fb8abcc187b49ff7b272bee4475dbb678b3..1dcf1d62c7af0424a690ce4224e747457336a7f3 100644
--- a/ui/gfx/geometry/point.h
+++ b/ui/gfx/geometry/point.h
@@ -132,6 +132,20 @@ inline Point PointAtOffsetFromOrigin(const Vector2d& offset_from_origin) {
// This should not be used in production code - call ToString() instead.
void PrintTo(const Point& point, ::std::ostream* os);
+// Helper methods to scale a gfx::Point to a new gfx::Point.
+GFX_EXPORT Point ScaleToCeiledPoint(const Point& point,
+ float x_scale,
+ float y_scale);
+GFX_EXPORT Point ScaleToCeiledPoint(const Point& point, float x_scale);
+GFX_EXPORT Point ScaleToFlooredPoint(const Point& point,
+ float x_scale,
+ float y_scale);
+GFX_EXPORT Point ScaleToFlooredPoint(const Point& point, float x_scale);
+GFX_EXPORT Point ScaleToRoundedPoint(const Point& point,
+ float x_scale,
+ float y_scale);
+GFX_EXPORT Point ScaleToRoundedPoint(const Point& point, float x_scale);
+
} // namespace gfx
#endif // UI_GFX_GEOMETRY_POINT_H_
« no previous file with comments | « ui/gfx/geometry/dip_util.cc ('k') | ui/gfx/geometry/point.cc » ('j') | ui/gfx/geometry/point.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698