diff options
Diffstat (limited to 'include/mbgl/util/size.hpp')
-rw-r--r-- | include/mbgl/util/size.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mbgl/util/size.hpp b/include/mbgl/util/size.hpp index 1af85bcff5..79679a92fb 100644 --- a/include/mbgl/util/size.hpp +++ b/include/mbgl/util/size.hpp @@ -13,6 +13,10 @@ public: constexpr Size(const uint32_t width_, const uint32_t height_) : width(width_), height(height_) { } + constexpr uint32_t area() const { + return width * height; + } + constexpr explicit operator bool() const { return width > 0 && height > 0; } |