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

Side by Side Diff: ui/gfx/vector2d.h

Issue 23498059: Remove last dependencies on ui/base from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last rebase Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/utf16_indexing.h ('k') | ui/gfx/vector2d_conversions.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Defines a simple integer vector class. This class is used to indicate a 5 // Defines a simple integer vector class. This class is used to indicate a
6 // distance in two dimensions between two points. Subtracting two points should 6 // distance in two dimensions between two points. Subtracting two points should
7 // produce a vector, and adding a vector to a point produces the point at the 7 // produce a vector, and adding a vector to a point produces the point at the
8 // vector's distance from the original point. 8 // vector's distance from the original point.
9 9
10 #ifndef UI_GFX_VECTOR2D_H_ 10 #ifndef UI_GFX_VECTOR2D_H_
11 #define UI_GFX_VECTOR2D_H_ 11 #define UI_GFX_VECTOR2D_H_
12 12
13 #include <string> 13 #include <string>
14 14
15 #include "base/basictypes.h" 15 #include "base/basictypes.h"
16 #include "ui/gfx/gfx_export.h" 16 #include "ui/gfx/gfx_export.h"
17 #include "ui/gfx/vector2d_f.h" 17 #include "ui/gfx/vector2d_f.h"
18 18
19 namespace gfx { 19 namespace gfx {
20 20
21 class UI_EXPORT Vector2d { 21 class GFX_EXPORT Vector2d {
22 public: 22 public:
23 Vector2d() : x_(0), y_(0) {} 23 Vector2d() : x_(0), y_(0) {}
24 Vector2d(int x, int y) : x_(x), y_(y) {} 24 Vector2d(int x, int y) : x_(x), y_(y) {}
25 25
26 int x() const { return x_; } 26 int x() const { return x_; }
27 void set_x(int x) { x_ = x; } 27 void set_x(int x) { x_ = x; }
28 28
29 int y() const { return y_; } 29 int y() const { return y_; }
30 void set_y(int y) { y_ = y; } 30 void set_y(int y) { y_ = y; }
31 31
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 inline Vector2d operator-(const Vector2d& lhs, const Vector2d& rhs) { 83 inline Vector2d operator-(const Vector2d& lhs, const Vector2d& rhs) {
84 Vector2d result = lhs; 84 Vector2d result = lhs;
85 result.Add(-rhs); 85 result.Add(-rhs);
86 return result; 86 return result;
87 } 87 }
88 88
89 } // namespace gfx 89 } // namespace gfx
90 90
91 #endif // UI_GFX_VECTOR2D_H_ 91 #endif // UI_GFX_VECTOR2D_H_
OLDNEW
« no previous file with comments | « ui/gfx/utf16_indexing.h ('k') | ui/gfx/vector2d_conversions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698