mirror of
https://github.com/virtcode/hypr-dynamic-cursors
synced 2025-09-20 00:23:22 +02:00
fix: div by zero on rotate if cursor starts at 0;0
when the plugin is loaded whilst the cursor pos is at 0;0, the `end` vector is being normalized allthough it will contain 0;0. this will produce a division by zero, causing the rotation to be set to NaN, ultimately causing the cursor not to render because of a NaN'd projection matrix thanks for reporting and testing @RGBCube
This commit is contained in:
parent
85423b074e
commit
527804e49c
1 changed files with 2 additions and 0 deletions
|
@ -19,6 +19,8 @@ SModeResult CModeRotate::update(Vector2D pos) {
|
||||||
|
|
||||||
// normalize
|
// normalize
|
||||||
double size = end.size();
|
double size = end.size();
|
||||||
|
if (size == 0) size = 1; // do not divide by 0
|
||||||
|
|
||||||
end.x /= size;
|
end.x /= size;
|
||||||
end.y /= size;
|
end.y /= size;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue