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

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

Issue 1372253002: gfx: Make conversions from gfx::Point to PointF explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pointfconvert-event: mandol_line Created 5 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/geometry/point.cc ('k') | ui/gfx/geometry/point_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/point_f.h
diff --git a/ui/gfx/geometry/point_f.h b/ui/gfx/geometry/point_f.h
index f900c1ceae727cf408afff98b81e4d30ae3ae5ad..d3a99f149c9f4547149da0822eddb60e7a5694f7 100644
--- a/ui/gfx/geometry/point_f.h
+++ b/ui/gfx/geometry/point_f.h
@@ -8,6 +8,7 @@
#include <iosfwd>
#include <string>
+#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/vector2d_f.h"
#include "ui/gfx/gfx_export.h"
@@ -20,6 +21,9 @@ class GFX_EXPORT PointF {
PointF(float x, float y) : x_(x), y_(y) {}
~PointF() {}
+ explicit PointF(const Point& p)
+ : PointF(static_cast<float>(p.x()), static_cast<float>(p.y())) {}
+
float x() const { return x_; }
float y() const { return y_; }
void set_x(float x) { x_ = x; }
« no previous file with comments | « ui/gfx/geometry/point.cc ('k') | ui/gfx/geometry/point_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698