+#endif
--- /dev/null
+++ giada/src/deps/geompp/src/range.hpp
-@@ -0,0 +1,61 @@
+@@ -0,0 +1,76 @@
+/* -----------------------------------------------------------------------------
+ *
+ * geompp - Basic geometrical utilities for C++.
+class Range
+{
+public:
-+ constexpr Range()
-+ : Range(0, 0)
++ constexpr Range() // Invalid default range
++ : a(0)
++ , b(0)
+ {
+ }
+
+ assert(a < b);
+ }
+
++ Range<T> operator*(const T m) const { return {a * m, b * m}; }
++ Range<T> operator*=(const T m) const { return {a * m, b * m}; }
++ Range<T> operator/(const T m) const { return {a / m, b / m}; }
++ Range<T> operator/=(const T m) const { return {a / m, b / m}; }
++ Range<T> operator+(const T m) const { return {a + m, b + m}; }
++ Range<T> operator+=(const T m) const { return {a + m, b + m}; }
++ Range<T> operator-(const T m) const { return {a - m, b - m}; }
++ Range<T> operator-=(const T m) const { return {a - m, b - m}; }
++
+ T getLength() const { return b - a; }
+
++ bool isValid() const
++ {
++ return a < b;
++ }
++
+ bool contains(T t) const
+ {
+ return t >= a && t < b;
+#endif
--- /dev/null
+++ giada/src/deps/geompp/src/rect.hpp
-@@ -0,0 +1,236 @@
+@@ -0,0 +1,234 @@
+/* -----------------------------------------------------------------------------
+ *
+ * geompp - Basic geometrical utilities for C++.
+#ifndef GEOMPP_RECT_HH
+#define GEOMPP_RECT_HH
+
++#include "border.hpp"
+#include "line.hpp"
+#include "point.hpp"
+#include "range.hpp"
+ yh = y + h;
+ }
+
-+ /* reduce (1)
-+ Reduces width and height by a certain amount around the center point. */
++ /* reduce
++ Reduces all four sides by a certain Border. */
+
-+ void reduce(T amountX, T amountY)
++ void reduce(Border<T> b)
+ {
-+ x += amountX;
-+ y += amountY;
-+ w -= amountX * 2;
-+ h -= amountY * 2;
++ x += b.left;
++ y += b.top;
++ w -= b.left + b.right;
++ h -= b.top + b.bottom;
+ xw = x + w;
+ yh = y + h;
+ }
+
-+ /* reduce (2)
-+ Reduces all four sides by a certain amount around the center point. */
-+
-+ void reduce(T amount) { reduce(amount, amount); }
-+
+ /* isValid
+ True if this Rect has size greater than zero. */
+
+ bool isValid() const { return w > 0 && h > 0; }
+
++ /* expand (1), (2)
++ The opposite of reduce (1), (2). */
++
++ void expand(T amountX, T amountY) { reduce(-amountX, -amountY); }
++ void expand(T amount) { reduce(-amount); }
++
+ /* with[...]
+ Returns a copy of this Rect with a new position/size. */
+
+
+ Point<T> getPosition() const { return Point(x, y); }
+
-+ /* reduced (1)
-+ Returns a copy of this Rect with width and height reduced by a certain
-+ amount. */
++ /* reduced
++ Returns a copy of this Rect with all four sides reduced by a certain Border. */
+
-+ Rect<T> reduced(T amountX, T amountY) const
++ Rect<T> reduced(Border<T> b) const
+ {
+ Rect r = *this;
-+ r.reduce(amountX, amountY);
++ r.reduce(b);
+ return r;
+ }
+
-+ /* reduced (2)
-+ Returns a copy of this Rect with all four sides reduced by a certain amount
-+ around the center point. */
++ /* expanded (1), (2)
++ The opposite of reduced (1), (2). */
+
-+ Rect<T> reduced(T amount) const
-+ {
-+ return reduced(amount, amount);
-+ }
++ Rect<T> expanded(T amountX, T amountY) const { return reduced(-amountX, -amountY); }
++ Rect<T> expanded(T amount) const { return reduced(-amount); }
+
+ /* contains (1)
+ Returns true if Point p is inside this Rect. */
+
+#endif
\ No newline at end of file
+--- /dev/null
++++ giada/src/deps/geompp/src/border.hpp
+@@ -0,0 +1,75 @@
++/* -----------------------------------------------------------------------------
++ *
++ * geompp - Basic geometrical utilities for C++.
++ *
++ * -----------------------------------------------------------------------------
++ *
++ * Copyright (C) 2021 Giovanni A. Zuliani | Monocasual Laboratories
++ *
++ * This file is part of geompp - Basic geometrical utilities for C++.
++ *
++ * geompp - Basic geometrical utilities for C++ is free software: you can
++ * redistribute it and/or modify it under the terms of the GNU General
++ * Public License as published by the Free Software Foundation, either
++ * version 3 of the License, or (at your option) any later version.
++ *
++ * geompp - Basic geometrical utilities for C++ is distributed in the hope that
++ * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
++ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++ * See the GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with geompp - Basic geometrical utilities for C++. If not, see
++ * <http://www.gnu.org/licenses/>.
++ *
++ * -------------------------------------------------------------------------- */
++
++#ifndef GEOMPP_BORDER_HH
++#define GEOMPP_BORDER_HH
++
++namespace geompp
++{
++template <typename T>
++class Border
++{
++public:
++ /* Border (1)
++ Empty border. */
++
++ constexpr Border()
++ : Border(0, 0, 0, 0)
++ {
++ }
++
++ /* Border (2)
++ Normal border. */
++
++ constexpr Border(T t, T r, T b, T l)
++ : top(t)
++ , right(r)
++ , bottom(b)
++ , left(l)
++ {
++ }
++
++ /* Border (3)
++ Normal border, all sides equal. */
++
++ constexpr Border(T v)
++ : Border(v, v, v, v)
++ {
++ }
++
++ /* Border (4)
++ Normal border, horizontal and vertical sides equal. */
++
++ constexpr Border(T x, T y)
++ : Border(y, x, y, x)
++ {
++ }
++
++ T top, right, bottom, left;
++};
++} // namespace geompp
++
++#endif
+\ No newline at end of file