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

Unified Diff: ui/gfx/vector2d_f.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build Created 8 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
« ui/gfx/vector2d_f.h ('K') | « ui/gfx/vector2d_f.h ('k') | ui/ui.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/vector2d_f.cc
diff --git a/ui/gfx/vector2d_f.cc b/ui/gfx/vector2d_f.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7612223690e868cc3a15d9318ea9f5c893fed214
--- /dev/null
+++ b/ui/gfx/vector2d_f.cc
@@ -0,0 +1,24 @@
+// 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 "base/stringprintf.h"
+#include "ui/gfx/vector2d_f.h"
+
+namespace gfx {
+
+Vector2dF::Vector2dF()
+ : m_x(0),
+ m_y(0) {
+}
+
+Vector2dF::Vector2dF(float x, float y)
+ : m_x(x),
+ m_y(y) {
+}
+
+std::string Vector2dF::ToString() const {
+ return base::StringPrintf("[%f %f]", m_x, m_y);
+}
+
+} // namespace gfx
« ui/gfx/vector2d_f.h ('K') | « ui/gfx/vector2d_f.h ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698