Files
MapLibreParticleLab/include/mbgl/util/rect.hpp
Konstantin Käfer 056b4a988c fix boolean operators
2014-08-04 18:46:43 +02:00

23 lines
440 B
C++

#ifndef MBGL_UTIL_RECT
#define MBGL_UTIL_RECT
namespace mbgl {
template <typename T>
struct Rect {
inline Rect() {}
inline Rect(T x, T y, T w, T h) : x(x), y(y), w(w), h(h) {}
T x = 0, y = 0;
T w = 0, h = 0;
template <typename Number>
Rect operator *(Number value) const {
return Rect(x * value, y * value, w * value, h * value);
}
operator bool() const { return w != 0 && h != 0; }
};
}
#endif