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

Side by Side Diff: ui/gfx/geometry/scale.h

Issue 1315633002: gfx: Converge scale precision related differences to single class. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected simple nit. Created 5 years, 3 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
« no previous file with comments | « ui/gfx/geometry/BUILD.gn ('k') | ui/gfx/geometry/scale.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_GFX_GEOMETRY_SCALE_H_
6 #define UI_GFX_GEOMETRY_SCALE_H_
7
8 #include "ui/gfx/gfx_export.h"
9
10 namespace gfx {
11
12 class GFX_EXPORT Scale {
13 public:
14 explicit Scale(float value);
15 explicit Scale(const Scale& other);
16
17 float Value() const { return value_; }
18 float AbsoluteValue() const { return absolute_value_; }
19
20 Scale& operator=(const Scale& other);
21 bool operator<(const Scale& other) const;
22 bool operator>(const Scale& other) const;
23
24 private:
25 float absolute_value_;
26 float value_;
27 };
28
29 inline bool operator==(const Scale& lhs, const Scale& rhs) {
30 return lhs.Value() == rhs.Value();
31 }
32
33 inline bool operator!=(const Scale& lhs, const Scale& rhs) {
34 return lhs.Value() != rhs.Value();
35 }
36
37 } // namespace gfx
38
39 #endif // UI_GFX_GEOMETRY_SCALE_H_
OLDNEW
« no previous file with comments | « ui/gfx/geometry/BUILD.gn ('k') | ui/gfx/geometry/scale.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698