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

Unified Diff: ui/gfx/point_f.cc

Issue 10025004: Floating point based Point/Size/Rect and Insets (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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
« no previous file with comments | « ui/gfx/point_f.h ('k') | ui/gfx/rect_f.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/point_f.cc
diff --git a/ui/gfx/point_f.cc b/ui/gfx/point_f.cc
new file mode 100644
index 0000000000000000000000000000000000000000..061e019009c992f4838e71cb293429e14f2998eb
--- /dev/null
+++ b/ui/gfx/point_f.cc
@@ -0,0 +1,26 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gfx/point_f.h"
+
+#include "base/stringprintf.h"
+#include "ui/gfx/point.h"
+
+namespace gfx {
+
+PointF::PointF() : x_(0), y_(0) {
+}
+
+PointF::PointF(float x, float y) : x_(x), y_(y) {
+}
+
+Point PointF::ToPoint() const {
+ return Point(static_cast<int>(x_), static_cast<int>(y_));
+}
+
+std::string PointF::ToString() const {
+ return base::StringPrintf("%f,%f", x_, y_);
+}
+
+} // namespace gfx
« no previous file with comments | « ui/gfx/point_f.h ('k') | ui/gfx/rect_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698