PlayCover / PlayTools

Tools for keymapping, dynamic resolution, and more
GNU Affero General Public License v3.0
67 stars 56 forks source link

Fix scroll wheel zoom glitch #150

Closed XuYicong closed 3 months ago

XuYicong commented 3 months ago

Fixes PlayCover/PlayCover/issues/1022

Previous Implementation

Two touch points starting from the center of camera action plus/minus 100 in y axis and not changing the x axis, moving towards each other with velocity exponentially decrease and apart from each other exponentially increase.

New Implementation

Two touch points starting from upper/lower 1/4 equally divider point of the screen, with x axis in the center and y axis having equal distance to up/bottom edge and center. The moving speed is as the scroll wheel's is, but touches would lift off when they're to touch each other or to touch edge.

Actually #144 already limited touch points inside window, so that the exact glitch of PlayCover/PlayCover/issues/1022 no longer happens. But that also breaks how original scroll wheel zooming function works and makes it randomly move camera view-angle up and down. This PR fixes this.

The choice of moving direction of vertically up and down is because that, this line has the least possible buttons, as it's the farthest to a human's finger on a mobile device.