dndplayer / dnd-player

An online virtual DND playground to support online groups.
https://dnd-player.com
Other
1 stars 0 forks source link

Drag inverse local offset is wrong when rotation is applied #30

Closed chrisella closed 5 years ago

chrisella commented 5 years ago

A while ago I added the drag offset bits so it would drag from where the mouse clicked, rather than snap to the center of the sprite, but this doesn't seem to work properly if there is rotation applied to the object.

chrisella commented 5 years ago

RotationDragBug

chrisella commented 5 years ago

Scale seems to affect this also

chrisella commented 5 years ago

It turns out it wasn't rotation at-all, only scale had an effect on this so to fix I just apply the scale to the local offset gathered at drag start.