News: Portal
Our Simutrans site. You can find everything about Simutrans from here.

Android Zoom in/out with two fingers

Started by Yona-TYT, November 01, 2023, 05:08:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


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!.  ;)


Yes, one of the things I quickly unlearned to do in the Android version :-)
Bob Marley: No woman, no cry

Programmer: No user, no bugs


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.


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.


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.  ;)