Forien / foundryvtt-forien-token-rotation

3 stars 1 forks source link

[BUG] Rotation behaviour does not work as intended in Mozilla Firefox #1

Open Keirsti opened 4 years ago

Keirsti commented 4 years ago

Module Version: v0.1.1

Describe the bug When attempting to click and drag the anchor to rotate a token using this module, the rotation does not occur (or, rather, seems to occur only briefly) - instead, Firefox seems to treat this as an attempt to drag the image associated with the anchor (i.e. to drag and drop it in another window or application). Testing in Chrome on the same device shows that the module indeed works as intended.

To Reproduce Steps to reproduce the behavior:

  1. Right-click a token
  2. Click on the anchor image
  3. Drag the image to attempt to rotate the token
  4. Token will not rotate; instead, anchor image will be 'cloned' like when attempting to drag an image

Expected behavior Token rotation works as described in the module - drag the anchor image around the token to rotate the token

Screenshots image Screenshot taken while attempting to drag the anchor to rotate.

Browser: Mozilla Firefox 78.0.2 (64-bit) - does not work as expected Google Chrome 83.0.4103.116 (64-bit) - does work as expected

Foundry Version: 0.6.5 (Release Channel) Game System: D&D 5e Additional context n/a

Forien commented 4 years ago

Again into the cross-browser compatibility abyss...

Thanks for reporting, will try to reproduce and fix if possible, but at this moment I can't promise anything.

Keirsti commented 4 years ago

If it's unresolveable or not worth the effort, it's not the end of the world - I can switch browsers or mousewheel rotate and keep it installed for my players if they want to use something Chromium-based - but I appreciate you taking a look. :)

Forien commented 4 years ago

It's currently too difficult for me. I will try to get back to it once I have more time.

To summarise:

  1. I use drag mouse events, that allow to freely drag item around, and in Chromium-based browsers sets coordinates of mouse to event
  2. I use coordinates to look for rotation
  3. FireFox does not set mouse coordinates for drag events. I could use mousemove event, but this has it's own limitation (like works only when mouse is on rotating handle), and any solution I could come up with was jerky at best, but that meant it would be jerky fo Chromium browsers as well.

So currently I'm out of ideas.

Bonus: while looking for a solution I broke my game :D
image

Keirsti commented 4 years ago

Understandable and acceptable - I'll let my folks know their options. Thanks for digging - and, uh, that sure is a screenshot haha.