williamngan / pts

A library for visualization and creative-coding
https://ptsjs.org
Apache License 2.0
5.16k stars 182 forks source link

Safari 15 // Group.moveTo not reflected #197

Open miha-stopar opened 1 year ago

miha-stopar commented 1 year ago

I am experiencing some strange problems on macOS Monterey / Safari 15.

The code looks like:

this.dragger.onDrag((ui, pt) => {
      const p = this.space.pointer.$subtract(ui.state('offset'))
      ui.group.moveTo(p)
      this.resizer.setCenter(ui.group[2])
    })

But the object is not moved, it just stays where it is. Strangely, after a right click (and context menu being opened) the object suddenly appears where it was (supposed to be) moved. But then again dragging doesn't work. It works in all other browsers that I tested (also other Safari versions). Any clue perhaps?

miha-stopar commented 1 year ago

Just tried Pts.js demos in Safari 15 and none seems to work. Any idea what might be wrong?

williamngan commented 1 year ago

Hi @miha-stopar, sorry for the late reply. I tried this demo ( https://ptsjs.org/demo/?name=ui.track ) in Safari 15.5 and the drag/click/etc functions seems to be working.

Can you verify if the above demo is working for you? If it is but you're still having issues with your own demo, can you provide the full code so that I can see if the bug can be reproduced?

miha-stopar commented 1 year ago

@williamngan Thanks for looking into it! I tried the demo with TestingBot using Safari 15.6.1 and it seems not to work - the cross is not moving and the circles cannot be dragged.

In Safari 14 everything seems to be ok, however it occurred a couple of times that in Safari 16 there was no interactivity until I refreshed the page. I couldn't figure it out when this happens yet.

williamngan commented 1 year ago

I updated to Safari 15.6.1 but I still can't reproduce the issue. Did you test it through some virtual machines in the cloud (using TestingBot)?

miha-stopar commented 1 year ago

Yes, I assume it uses virtual machines.

There's another thing, but I am not sure if it's related to the above - however, it appears only in Safari (in this case Safari 16.0). The problem is that when the Pts canvas is not at the top of the page some coordinates seem to be miscalculated - I have a similar visualisation as it is here and the eyes are staring down even when the cursor is above them. After refresh everything works fine.