cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Inconsistent usage of _buttonDown in ScreenSpaceEventHandler

Open masterkai89 opened this issue 3 years ago • 4 comments

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.

masterkai89 avatar Feb 26 '21 05:02 masterkai89

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.

shunter avatar Feb 26 '21 15:02 shunter

Hey @masterkai89 can I work on this issue?

GAURAV1-ui avatar Jul 21 '22 00:07 GAURAV1-ui