cesium
cesium copied to clipboard
Inconsistent usage of _buttonDown in ScreenSpaceEventHandler
Sandcastle example: NA
Browser: MS Edge 85.0.564.68
Operating System: Windows 10
I would like to highlight something which may possibly be a potential issue.
I found out that when creating a new ScreenSpaceEventHandler. It will assign the following default state object to _buttonDown
this._buttonDown = { LEFT: !1, MIDDLE: !1 RIGHT : !1 }
Further debugging has led me to found out that methods such as handleMouseDown or handleMouseUp instead uses an integer value from 'button' to assign or get value from _buttonDown. Assuming a left doen click was done and never release, this will result _buttonDown to become as such
{ 0: true, LEFT: false, MIDDLE: false RIGHT : false }
I believe the fix would be to just replace the key with the respective integer value.
Looks like this was broken by #7258. As far as I can tell, nothing ever uses these string keys, so I don't think there's any error in behavior as a result of them being present and ignored. We could probably just remove them.
Hey @masterkai89 can I work on this issue?