Fix snapped implementation, it was not snapping size correctly
parent
fb952ef119
commit
43588cae17
|
@ -239,7 +239,10 @@ public:
|
|||
}
|
||||
|
||||
inline Rect3i snapped(int step) const {
|
||||
return Rect3i(pos.floordiv(step) * step, size.floordiv(step) * step);
|
||||
Rect3i r = downscaled(step);
|
||||
r.pos *= step;
|
||||
r.size *= step;
|
||||
return r;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -91,6 +91,12 @@ struct Vector3i {
|
|||
z -= other.z;
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ void operator*=(const int s) {
|
||||
x *= s;
|
||||
y *= s;
|
||||
z *= s;
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ Vector3i operator-() const {
|
||||
return Vector3i(-x, -y, -z);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue