The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: ronnie89b on January 14, 2022, 09:19:15 PM

Title: Scrolling bug 123.0
Post by: ronnie89b on January 14, 2022, 09:19:15 PM
I tried the new stable version, 123.0, and i noticed the scrolling changed. Now when you click and move the mouse, the scrolling stops when you reach the side of the screen, and you have to click again to continue. In the previous versions you can scrolling from one corner of the map to another with only one click.
This bug (or feature?) is still in 10356 nightly.
Title: Re: Scrolling bug 123.0
Post by: prissi on January 15, 2022, 05:55:07 AM
This is due to an issue with SDL2 and mouse repositioning when using finger input. It seems one can only have on or the other.

But I will look into this again.
Title: Re: Scrolling bug 123.0
Post by: prissi on January 28, 2022, 01:34:06 AM
In r10415 I used to reposition after a threshold, which still gives infinite scrolling but is still finger friendly. Please try.
Title: Re: Scrolling bug 123.0
Post by: prissi on January 28, 2022, 12:43:58 PM
The previous commit was wrong.

The problem is that there are relative devices (mouse trackpad) and absolute devices (finger stylus lightpen). Mouse cursor repositioning only works for former, of course. Unfortunately, neither windows nor SDL2 properly separates between those two. I have a touchscreen with pen support. The finger is handled as finger, but the stylus is handled as mouse.

To make matter worse for some weird reason, SDL2 returns relative coordinates for finger movements and absolute for the mouse, which does not make sense very much. So in order to have infinite mouse scrolling, one has to reposition the mouse (or get input deep inside windows, which ignores mouse speed settings.) But windows has no way to tell if this is from a relative or absolute device and SLD2 gets it wrong every second time on my device as well.

I think the only way to have infinite scrolling is when you know you have no touch devices that are handled as mouse. So I will ad a button to try to get inifite scrolling, which will be off by default.

See r10419
Title: Re: Scrolling bug 123.0
Post by: ronnie89b on January 30, 2022, 10:12:57 AM
It's working again with a mouse, thanks!
Title: Re: Scrolling bug 123.0
Post by: Roboron on January 31, 2022, 11:49:09 AM
I think you (prissi) inverted the option text and the tooltip text unintentionally. Or so it seems to me.
Title: Re: Scrolling bug 123.0
Post by: prissi on January 31, 2022, 12:19:35 PM
EDIT: You mean in the translator. Indeed, I corrected them there (and your spanish as well),
Title: Re: Scrolling bug 123.0
Post by: captain crunch on January 31, 2022, 08:39:02 PM
I can not use mouse drag to build road/rail anymore, it moves the map instead.
This is probably related to these changes.
Version: Simutrans 123.0.2 Nightly svn r10426 amd64/linux/SDL2
Title: Re: Scrolling bug 123.0
Post by: prissi on February 01, 2022, 02:05:34 AM
Found out and corrected this already. You could still built the old way though with two click ...

r10428 fixes this again.
Title: Re: Scrolling bug 123.0
Post by: captain crunch on February 01, 2022, 11:05:52 AM
Yes! Thank you!