The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: Yona-TYT on February 27, 2022, 09:34:54 PM

Title: Infinite scrolling problem on the map
Post by: Yona-TYT on February 27, 2022, 09:34:54 PM
Last night of simutrans on linux.

When I scroll on the map I often get a little stuck and suddenly I find myself at another end of the map, far away from where I was, in other words, the scroll goes much farther than the mouse would normally reach while dragging.

This is really annoying when scrolling around the map.

I wonder if it only happens on my pc?.
Title: Re: Infinite scrolling problem on the map
Post by: prissi on February 28, 2022, 12:47:04 AM
It happened with me sometimes as well, but I am not sure of the reason. It seems sometimes DRAG events come without a preceeding click event, and thus the last offset is used instead starting a zero.
Title: Re: Infinite scrolling problem on the map
Post by: Matthew on February 28, 2022, 09:18:02 AM
This might be the same issue as this bug report (https://forum.simutrans.com/index.php/topic,21448.0.html) in Extended.
Title: Re: Infinite scrolling problem on the map
Post by: prissi on February 28, 2022, 12:08:03 PM
No, extended merged a not finished refurbishement for touch usage.
Title: Re: Infinite scrolling problem on the map
Post by: R1dO on February 28, 2022, 12:27:00 PM
Happened to me as well.

Did some basic testing but did not really find the reason (to little experience with this codebase).

Some of the things i observed:
* Already happens on buttondown (both left as right click)
* Seems to happen "randomly"
* Easier to reproduce when "clicking like a madman".
  - It is a pretty soft conclusion though, since it also happens when clicking (and moving the mouse) really slow.

Whenever the problems occur it can be observed that the events as send to  "interaction_t::move_view()" contain spurious values [1].
In my limited testing the "ev.cx" value was off by a few hundred on each occasion.

[1] Based on inserting some print statements since that looked like a good starting point. What is causing these jumps kinda eludes me at the moment.
Title: Re: Infinite scrolling problem on the map
Post by: prissi on March 01, 2022, 02:55:50 AM
It seems sometimes the click event comes after a mouse move event with button down. For that case I added in r10517 extra code to initialise cx and cy on the first dragging event.
Title: Re: Infinite scrolling problem on the map
Post by: Yona-TYT on March 03, 2022, 01:16:57 AM
I have tried and it works better, however I would like more people to confirm this.
Title: Re: Infinite scrolling problem on the map
Post by: prissi on March 13, 2022, 11:30:33 AM
No further complains, so I close this ...