The International Simutrans Forum

Development => Bug Reports => Topic started by: victor_18993 on August 20, 2026, 05:01:29 AM

Title: [Fixed r12179] Mouse-wheel zoom could jump after navigating with the minimap
Post by: victor_18993 on August 20, 2026, 05:01:29 AM
Fixed in SVN r12179.

There was a stale-position issue in mouse-wheel zoom after navigating through the minimap.

The minimap changes the main viewport position, but the world cursor position used by the zoom code could still refer to the location from before the minimap jump. As a result, the first mouse-wheel zoom could use that old tile as its anchor and unexpectedly move the viewport far away from the location selected on the minimap.

The wheel zoom now determines its anchor from the current mouse position instead.

Verified on current trunk:

- the original minimap -> close -> first wheel reproducer no longer jumps;
- normal mouse-wheel zoom keeps its existing behaviour;
- invalid/outside-map positions keep the previous guard behaviour;
- mouse-wheel handling inside the minimap is unchanged;
- full automated test suite: 286/286.

Integrated as:

r12179 — FIX: anchor mouse-wheel zoom on the tile under the mouse

This is a local UI/view correction only. There are no network, savegame or pak-format changes.