mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-07-14 16:15:14 +01:00
Codechange: Make geometry methods constexpr.
This commit is contained in:
parent
68843e3a96
commit
a5b6e17556
@ -57,13 +57,13 @@ struct RectPadding {
|
|||||||
* Get total horizontal padding of RectPadding.
|
* Get total horizontal padding of RectPadding.
|
||||||
* @return total horizontal padding.
|
* @return total horizontal padding.
|
||||||
*/
|
*/
|
||||||
inline uint Horizontal() const { return this->left + this->right; }
|
constexpr uint Horizontal() const { return this->left + this->right; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get total vertical padding of RectPadding.
|
* Get total vertical padding of RectPadding.
|
||||||
* @return total vertical padding.
|
* @return total vertical padding.
|
||||||
*/
|
*/
|
||||||
inline uint Vertical() const { return this->top + this->bottom; }
|
constexpr uint Vertical() const { return this->top + this->bottom; }
|
||||||
};
|
};
|
||||||
|
|
||||||
inline const RectPadding RectPadding::zero{};
|
inline const RectPadding RectPadding::zero{};
|
||||||
|
Loading…
Reference in New Issue
Block a user