fix: show cursor in certain rotate edge cases

this fixes another NaN caused in cases where the `end` vector of the
rotate mode is at y = 0. this might be caused by various factors,
notably again when the cursor starts at 0;0

thanks again @RGBCube
This commit is contained in:
Virt 2024-07-11 16:53:06 +02:00
commit ee5f66775a

View file

@ -34,6 +34,8 @@ SModeResult CModeRotate::update(Vector2D pos) {
angle += PI;
angle += offset * ((2 * PI) / 360); // convert to radiants
if (end.y == 0) angle = 0; // do not divide by 0 above, leave untransformed in these cases
// translate back
end.x += pos.x;
end.y += pos.y;