Browse Source

Add Rect::interpolate().

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
802f71eb8e
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      include/math.hpp

+ 4
- 0
include/math.hpp View File

@@ -427,6 +427,10 @@ struct Rect {
r.size = size.minus(delta.mult(2.f)); r.size = size.minus(delta.mult(2.f));
return r; return r;
} }
/** Returns `pos + size * p` */
Vec interpolate(Vec p) {
return pos.plus(size.mult(p));
}


// Method aliases // Method aliases
bool isContaining(Vec v) const { bool isContaining(Vec v) const {


Loading…
Cancel
Save