mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-19 16:13:21 +02:00
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:
parent
527804e49c
commit
ee5f66775a
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue