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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/insets_f.h"
6
7 #include "base/stringprintf.h" 5 #include "base/stringprintf.h"
6 #include "ui/gfx/vector2d.h"
8 7
9 namespace gfx { 8 namespace gfx {
10 9
11 std::string InsetsF::ToString() const { 10 Vector2d::Vector2d()
12 // Print members in the same order of the constructor parameters. 11 : m_x(0),
13 return StringPrintf("%f,%f,%f,%f", top_, left_, bottom_, right_); 12 m_y(0) {
13 }
14
15 Vector2d::Vector2d(int x, int y)
16 : m_x(x),
17 m_y(y) {
18 }
19
20 std::string Vector2d::ToString() const {
21 return base::StringPrintf("[%d %d]", m_x, m_y);
14 } 22 }
15 23
16 } // namespace gfx 24 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698