neutralinojs / neutralino.js

JavaScript API for Neutralinojs
https://neutralino.js.org/docs/api/overview
MIT License
237 stars 47 forks source link

timeTillLastMove issue #127

Open OreoCookieRustDev opened 1 month ago

OreoCookieRustDev commented 1 month ago
                    const timeTillLastMove = currentMilliseconds - lastMoveTimestamp;
                    if (timeTillLastMove < 5) {
                        // Do not execute move more often than 1x every 5ms or performance will drop
                        return;
                    }

In the above code found on neutralino.mjs at line 591, this will create an issue.

The first time the code is run, the currentMilliseconds will be undefined The lastMoveTimestamp will also be undefined, resulting in NaN.

This means the click and drug function will cause all sorts of glichy behavior and/or not work at all until the mouse is first moved 10px, then must stop and wait for at least 5 ms before it will actually be draggable.