1 #pragma once 2 3 namespace mbgl { 4 5 template <typename T> 6 struct Rect { 7 Rect() = default; Rectmbgl::Rect8 Rect(T x_, T y_, T w_, T h_) : x(x_), y(y_), w(w_), h(h_) {} 9 T x = 0, y = 0; 10 T w = 0, h = 0; 11 12 template <typename Number> operator *mbgl::Rect13 Rect operator *(Number value) const { 14 return Rect(x * value, y * value, w * value, h * value); 15 } 16 17 template <typename R> operator ==mbgl::Rect18 bool operator==(const R& r) const { 19 return x == r.x && y == r.y && w == r.w && h == r.h; 20 } 21 hasAreambgl::Rect22 bool hasArea() const { return w != 0 && h != 0; } 23 }; 24 } // namespace mbgl 25