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

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: remove SizeOfVector 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
Index: ui/gfx/vector2d_f.cc
diff --git a/ui/gfx/insets_f.cc b/ui/gfx/vector2d_f.cc
similarity index 50%
copy from ui/gfx/insets_f.cc
copy to ui/gfx/vector2d_f.cc
index 54aa131bbf9330b6e393ee0e5b4d70c70392bbf0..b95a2bc35f8d850fbe531d143b57cf159f360ccc 100644
--- a/ui/gfx/insets_f.cc
+++ b/ui/gfx/vector2d_f.cc
@@ -2,15 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/insets_f.h"
-
#include "base/stringprintf.h"
+#include "ui/gfx/vector2d_f.h"
namespace gfx {
-std::string InsetsF::ToString() const {
- // Print members in the same order of the constructor parameters.
- return StringPrintf("%f,%f,%f,%f", top_, left_, bottom_, right_);
+Vector2dF::Vector2dF()
+ : x_(0),
+ y_(0) {
+}
+
+Vector2dF::Vector2dF(float x, float y)
+ : x_(x),
+ y_(y) {
+}
+
+std::string Vector2dF::ToString() const {
+ return base::StringPrintf("[%f %f]", x_, y_);
}
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698