aboutsummaryrefslogtreecommitdiff
path: root/src/ui/ui_base.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-10-04 01:47:49 +0800
committercrupest <crupest@outlook.com>2018-10-04 01:47:49 +0800
commit01ab4511d3006e9f65ff96ae63b21de14b41bc48 (patch)
treee4fa991e7784571c164301ff7ade5aa1ef515744 /src/ui/ui_base.h
parent30ecda8bb354d5982978af97aa90b5f49d9ea195 (diff)
downloadcru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.tar.gz
cru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.tar.bz2
cru-01ab4511d3006e9f65ff96ae63b21de14b41bc48.zip
...
Diffstat (limited to 'src/ui/ui_base.h')
-rw-r--r--src/ui/ui_base.h35
1 files changed, 10 insertions, 25 deletions
diff --git a/src/ui/ui_base.h b/src/ui/ui_base.h
index 43f3c498..51ae4084 100644
--- a/src/ui/ui_base.h
+++ b/src/ui/ui_base.h
@@ -53,6 +53,16 @@ namespace cru
return Size(left.width - right.width, left.height - right.height);
}
+ constexpr bool operator==(const Size& left, const Size& right)
+ {
+ return left.width == right.width && left.height == right.height;
+ }
+
+ constexpr bool operator!=(const Size& left, const Size& right)
+ {
+ return !(left == right);
+ }
+
struct Rect
{
constexpr Rect() = default;
@@ -106,31 +116,6 @@ namespace cru
float height = 0.0f;
};
- struct Thickness
- {
- constexpr static Thickness Zero()
- {
- return Thickness(0);
- }
-
- constexpr Thickness() : Thickness(0) { }
-
- constexpr explicit Thickness(const float width)
- : left(width), top(width), right(width), bottom(width) { }
-
- constexpr explicit Thickness(const float horizontal, const float vertical)
- : left(horizontal), top(vertical), right(horizontal), bottom(vertical) { }
-
- constexpr Thickness(const float left, const float top, const float right, const float bottom)
- : left(left), top(top), right(right), bottom(bottom) { }
-
-
- float left;
- float top;
- float right;
- float bottom;
- };
-
enum class MouseButton
{
Left,