1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
---|---|
2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
3 | #pragma once |
4 | |
5 | #include "BsPrerequisites.h" |
6 | |
7 | namespace bs |
8 | { |
9 | /** @addtogroup Utility-Engine |
10 | * @{ |
11 | */ |
12 | |
13 | /** Rectangle represented in the form of offsets from some parent rectangle. */ |
14 | struct BS_SCRIPT_EXPORT(pl:true,m:Math) RectOffset |
15 | { |
16 | RectOffset() = default; |
17 | |
18 | RectOffset(INT32 left, INT32 right, INT32 top, INT32 bottom) |
19 | :left(left), right(right), top(top), bottom(bottom) |
20 | { } |
21 | |
22 | bool operator==(const RectOffset& rhs) const |
23 | { |
24 | return left == rhs.left && right == rhs.right && top == rhs.top && bottom == rhs.bottom; |
25 | } |
26 | |
27 | bool operator!=(const RectOffset& rhs) const |
28 | { |
29 | return !operator==(rhs); |
30 | } |
31 | |
32 | INT32 left = 0; |
33 | INT32 right = 0; |
34 | INT32 top = 0; |
35 | INT32 bottom = 0; |
36 | }; |
37 | |
38 | /** @} */ |
39 | |
40 | /** @cond SPECIALIZATIONS */ |
41 | BS_ALLOW_MEMCPY_SERIALIZATION(RectOffset); |
42 | /** @endcond */ |
43 | } |