Skip to content

Improve accuracy of zooming to cursor#3227

Merged
AaronVanGeffen merged 3 commits intoOpenLoco:masterfrom
AaronVanGeffen:zoom-cursor
Sep 6, 2025
Merged

Improve accuracy of zooming to cursor#3227
AaronVanGeffen merged 3 commits intoOpenLoco:masterfrom
AaronVanGeffen:zoom-cursor

Conversation

@AaronVanGeffen
Copy link
Copy Markdown
Member

Zooming to cursor is one of the features we implemented in OpenLoco early on. The implementation is way more complicated than necessary, though, using land surfaces tiles as intermediaries. This PR removes this, and instead uses the viewport position relative to the mouse cursor to offset the new zoom level.

For completeness: this is an adaptation of OpenRCT2/OpenRCT2#25042

Copy link
Copy Markdown
Contributor

@LeftofZen LeftofZen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WOW this is a huge improvement, I've always had small zooming issues but this works very well, nice work! It's even stable - zooming in and out repeatedly on the same pixel preserves that pixel position exactly <3

@AaronVanGeffen AaronVanGeffen merged commit 030cbef into OpenLoco:master Sep 6, 2025
11 checks passed
@AaronVanGeffen AaronVanGeffen deleted the zoom-cursor branch September 6, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants