dndplayer / dnd-player

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

Rework dragging logic so a click selection can be distinguished from a drag #24

Closed chrisella closed 5 years ago

chrisella commented 5 years ago

Currently any clicking interaction with an object that inherits our class DraggableContainer will perform dragging functionality. To be able to perform selection of objects at the point of click we'll need to not so eagerly go into "dragging" mode and first see if the mouseUp event occurs with no or minimal movement, in which case a click was triggered (possibly causing a selection) instead of a drag.

This will also need click off to de-select, keeping in mind that the whole background could be a scenery object that isSelectable = false, so I don't know if the event would go through to the stage behind to handle the event. Going to need to test and tweak this.

Extra notes: