diff --git a/include/math.hpp b/include/math.hpp index df9b2866..7b55a7ae 100644 --- a/include/math.hpp +++ b/include/math.hpp @@ -427,6 +427,10 @@ struct Rect { r.size = size.minus(delta.mult(2.f)); return r; } + /** Returns `pos + size * p` */ + Vec interpolate(Vec p) { + return pos.plus(size.mult(p)); + } // Method aliases bool isContaining(Vec v) const {