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

Side by Side 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, 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_f.h"
8 7
9 namespace gfx { 8 namespace gfx {
10 9
11 std::string InsetsF::ToString() const { 10 Vector2dF::Vector2dF()
12 // Print members in the same order of the constructor parameters. 11 : x_(0),
13 return StringPrintf("%f,%f,%f,%f", top_, left_, bottom_, right_); 12 y_(0) {
13 }
14
15 Vector2dF::Vector2dF(float x, float y)
16 : x_(x),
17 y_(y) {
18 }
19
20 std::string Vector2dF::ToString() const {
21 return base::StringPrintf("[%f %f]", x_, y_);
14 } 22 }
15 23
16 } // namespace gfx 24 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698