Files
MapLibreParticleLab/include/mln/util/rect.hpp
Bart Louwers 2a8ebc4906 core: rename mbgl directories to mln (#4511)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-08-22 20:50:14 +02:00

29 lines
587 B
C++

#pragma once
namespace mln {
template <typename T>
struct Rect {
Rect() = default;
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);
}
template <typename R>
bool operator==(const R& r) const {
return x == r.x && y == r.y && w == r.w && h == r.h;
}
bool hasArea() const { return w != 0 && h != 0; }
};
} // namespace mln