Returns a new Vec that is as near to vec as possible while being in bounds.
vec
Vec clamp(Vec vec) { var x = vec.x.clamp(left, right).toInt(); var y = vec.y.clamp(top, bottom).toInt(); return Vec(x, y); }