The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Yona-TYT on November 01, 2023, 05:08:46 PM

Title: Android Zoom in/out with two fingers
Post by: Yona-TYT on November 01, 2023, 05:08:46 PM


Using two fingers on Android to zoom in or out of the map is working incorrectly.

Apparently this particular gesture overloads the process with a lot of interactions which causes simutrans to freeze for several seconds or minutes (depends on the device).


I suppose fixing this must be quite a challenge, but if it were achieved it would be something wonderful, since this function on touch devices is essential!.  ;)
Title: Re: Android Zoom in/out with two fingers
Post by: Combuijs on November 02, 2023, 09:58:48 AM
Yes, one of the things I quickly unlearned to do in the Android version :-)
Title: Re: Android Zoom in/out with two fingers
Post by: prissi on November 04, 2023, 12:09:53 PM
It is a little hard to do this correctly. The problem is that sometimes SDL fires many zoom messages one after the other and other times there is only a single one. Also zooming out in Android takes its time as the CPUs tend to be much slower. I will see if I can hack the event system to drop any zoom message if the last one was less than a second ago.
Title: Re: Android Zoom in/out with two fingers
Post by: prissi on November 04, 2023, 02:21:09 PM
Swallowing all subsequent 10000+ finger events after a single zoom or three-finger-scroll event seems to do the trick (on windows at least). Check -r11000.
Title: Re: Android Zoom in/out with two fingers
Post by: Yona-TYT on November 04, 2023, 03:45:31 PM
The difference now is notable!. 8)

You really are good at hacking code. Hehehe ;D


Thank you very much, now simutrans is more playable on Android.  ;)