diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-07-16 18:53:56 -0700 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-07-16 18:53:56 -0700 |
commit | 4ea281c750c5afcc68f2832bb42d98a1cbce6735 (patch) | |
tree | 60bc7d3ccba2c54859e2e023997cc027cc67aea7 /include/mbgl/util/rect.hpp | |
parent | c1a64dc5fa73b54cc5de77629781dfc74302a1e7 (diff) | |
download | qtlocation-mapboxgl-4ea281c750c5afcc68f2832bb42d98a1cbce6735.tar.gz |
rename llmr => mbgl
Diffstat (limited to 'include/mbgl/util/rect.hpp')
-rw-r--r-- | include/mbgl/util/rect.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/mbgl/util/rect.hpp b/include/mbgl/util/rect.hpp new file mode 100644 index 0000000000..a216b8e145 --- /dev/null +++ b/include/mbgl/util/rect.hpp @@ -0,0 +1,21 @@ +#ifndef MBGL_UTIL_RECT +#define MBGL_UTIL_RECT + +namespace mbgl { + +template <typename T> +struct Rect { + explicit 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 |