OLD | NEW |
(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_ |
OLD | NEW |