News:

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

Infinite scrolling problem on the map

Started by Yona-TYT, February 27, 2022, 09:34:54 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

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?.

prissi

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.

Matthew

(Signature being tested) If you enjoy playing Simutrans, then you might also enjoy watching Japan Railway Journal
Available in English and simplified Chinese
如果您喜欢玩Simutrans的话,那么说不定就想看《日本铁路之旅》(英语也有简体中文字幕)。

prissi

No, extended merged a not finished refurbishement for touch usage.

R1dO

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.

prissi

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.

Yona-TYT

I have tried and it works better, however I would like more people to confirm this.

prissi

No further complains, so I close this ...