# HG changeset patch # User Peter Nelson # Date 2024-01-15 22:49:25 # Node ID 781fef3b0a48244ce0bbe7386f3c03f71be5c235 # Parent 6c45ae85594cf8aeadd016161a5b749c31153e84 Codechange: Make geometry methods constexpr. diff --git a/src/core/geometry_type.hpp b/src/core/geometry_type.hpp --- a/src/core/geometry_type.hpp +++ b/src/core/geometry_type.hpp @@ -57,13 +57,13 @@ struct RectPadding { * Get total horizontal padding of RectPadding. * @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. * @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{};