litegraph.js icon indicating copy to clipboard operation
litegraph.js copied to clipboard

Touch position wrong when scrolled

Open leandersonralves opened this issue 6 years ago • 8 comments

When scrolled, mouse event position is wrong and dont touch a slot in node.

leandersonralves avatar Nov 23 '18 18:11 leandersonralves

Sugestion: Line 4879

e.canvasX = e.offsetX;
e.canvasY = e.offsetY;

leandersonralves avatar Nov 23 '18 18:11 leandersonralves

I will check it next week, never embeded a graph in a regular website

jagenjo avatar Nov 23 '18 18:11 jagenjo

After more test, I suggest:

Lines 2864 and 2865 e.localX = e.offsetX; e.localY = e.offsetY;

leandersonralves avatar Nov 29 '18 19:11 leandersonralves

Hi, was this issue corrected? Because when using litegraph on a page that has scrolled down, I can't select the nodes unless i click a little bit up of the node (the size of the scroll).

calvaradocl avatar Apr 01 '19 18:04 calvaradocl

I just uploaded a version, let me know if the bug is fixed.

jagenjo avatar Apr 01 '19 18:04 jagenjo

Hi @jagenjo, the issue was corrected on Chrome and Firefox, but it persists on Edge (42.17134.1.0), don't know if you plan to support that browser.

calvaradocl avatar Apr 01 '19 18:04 calvaradocl

I guess thats a bug from edge, the current function relies on clientY and getClientBoundingRect which are well defined functions in the standard, so if some weird thing happens in Edge it must be a bug on that browser. If you manage to see a work around let me know, I cannot test it as I dont have Edge. I leave this issue open.

jagenjo avatar Apr 01 '19 20:04 jagenjo

Ok, I'll try to run some tests and check if I can find out a fix with the update that you uploaded today.

calvaradocl avatar Apr 02 '19 00:04 calvaradocl