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

Unified Diff: ui/gfx/vector2d.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
Index: ui/gfx/vector2d.cc
diff --git a/ui/gfx/insets_f.cc b/ui/gfx/vector2d.cc
similarity index 50%
copy from ui/gfx/insets_f.cc
copy to ui/gfx/vector2d.cc
index 54aa131bbf9330b6e393ee0e5b4d70c70392bbf0..edc9cbe196104b05ee44a2a365a337dad786613f 100644
--- a/ui/gfx/insets_f.cc
+++ b/ui/gfx/vector2d.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.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_);
+Vector2d::Vector2d()
+ : m_x(0),
+ m_y(0) {
+}
+
+Vector2d::Vector2d(int x, int y)
+ : m_x(x),
+ m_y(y) {
+}
+
+std::string Vector2d::ToString() const {
+ return base::StringPrintf("[%d %d]", m_x, m_y);
}
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698