This change restructures the multitouch handling code both on the front-end and in extension code such that we follow the new protocol. Now, instead of having separate command for multitouch, we allow for the dispatchTouch method to take an array of touches (typically one or two). Then, we send touchDown or similar command with additional coordinates after the x and y of the first pointer are added.
The main change on the frontend was that we don't send leading point and anchor points but instead send two concrete touch points,. This removes coupling because sim-server and frontend code as otherwise we'd need to have code that calculates touch points on both sides (including logic related to rounding etc)
This PR also updates some parts of the rpc code that I needed for one stage of the changes since we werent handling null value correctly (which apparently has typeof = 'object' in JS)
This PR builds on top of changes from https://github.com/software-mansion-labs/simulator-server/pull/173 where we add support for multitouch events to be dispatched to device (Android for the time being).
This change restructures the multitouch handling code both on the front-end and in extension code such that we follow the new protocol. Now, instead of having separate command for multitouch, we allow for the dispatchTouch method to take an array of touches (typically one or two). Then, we send
touchDown
or similar command with additional coordinates after the x and y of the first pointer are added.The main change on the frontend was that we don't send leading point and anchor points but instead send two concrete touch points,. This removes coupling because sim-server and frontend code as otherwise we'd need to have code that calculates touch points on both sides (including logic related to rounding etc)
This PR also updates some parts of the rpc code that I needed for one stage of the changes since we werent handling
null
value correctly (which apparently has typeof = 'object' in JS)Test plan
This has been tested on custom sim-server build that includes https://github.com/software-mansion-labs/simulator-server/pull/173 by opening an app with zoomable control on Android (I used photo gallery)