added Recti.contains
This commit is contained in:
parent
21c4d8ccdc
commit
a7d8b9f5c7
|
@ -54,4 +54,12 @@ public final class Recti {
|
|||
public Vec2i getBottomRight() {
|
||||
return Vec2i.add(pos, size);
|
||||
}
|
||||
|
||||
public boolean contains(Vec2i vec) {
|
||||
var br = getBottomRight();
|
||||
return vec.getX() >= pos.getX() &&
|
||||
vec.getY() >= pos.getY() &&
|
||||
vec.getX() <= br.getX() &&
|
||||
vec.getY() <= br.getY();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue