neutralinojs / neutralino.js

JavaScript API for Neutralinojs

Home Page:https://neutralino.js.org/docs/api/overview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setDraggableRegion laggy

ratatoeskr666 opened this issue · comments

I found out that the event handling of setDraggableRegion leads to lags. I guess it's due to too many pointermove event invocations at once.
On every invocation a message is being sent via websocket to the app.
We need some kind of throttleTime (see rxjs) which reduces the amount of pointer move invocations.

I already implemented my own movement logic (which uses rxjs observables and throttleTime) and reduced the amount of pointermove events to 1 every 4ms. And it works smoothly. No more lags.

I will spare some time and look into writing a solution without rxjs and create a pull request for this issue if you agree

Closed via #83.. Thanks for the pull request :) Btw. would you like to display your GitHub username/name with link on [this list]?(https://neutralino.js.org/docs/contributing/committers) -- we often update this list with contributors who did very good contributions 🎉

Closed via #83.. Thanks for the pull request :) Btw. would you like to display your GitHub username/name with link on [this list]?(https://neutralino.js.org/docs/contributing/committers) -- we often update this list with contributors who did very good contributions 🎉

sure, thank you very much! I really like neutralino and looking forward to contribute more in the future

But you tested the changes, didn't you? As I wrote in the Pull Request: I, unfortunatly, couldn't test the changes yet. I have no idea if the code I committed works (shame on me)

Great @ratatoeskr666, I made neutralinojs/neutralinojs.github.io#282 to add your GitHub profile to the Neutralinojs website. Regarding the PR, yeah I tested by adjusting threshholds -- the event throttling concept worked for me. May be later we can use a common throttling algorithm with setTimeout, but your implementation also looks great.

Thanks 🎉

Glad to hear. Thank you very much!