Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save less state in minimap_view #2409

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

lmoureaux
Copy link
Contributor

The widget needs to compute horizontal and vertical scaling factors to map between the displayed minimap (in pixel units) and the computed one (essentially in tile units). It was computing them on resize events and storing them, which was causing issues when switching maps. Compute them when they are needed instead, it's just two float divisions.

Also remove a bunch of unused variables from the class.

Closes #1657.

The widget needs to compute horizontal and vertical scaling factors to
map between the displayed minimap (in pixel units) and the computed one
(essentially in tile units). It was computing them on resize events and
storing them, which was causing issues when switching maps. Compute them
when they are needed instead, it's just two float divisions.

Also remove a bunch of unused variables from the class and don't try to
move() it when shown (it's in a layout).

Closes longturn#1657.
Copy link
Contributor

@hugomflavio hugomflavio left a comment

Choose a reason for hiding this comment

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

Tested switching between two games without closing the client. The mini-map resized correctly. Glad to see this one resolved! Also tested changing zoom levels; the mini-map also responded well.

Copy link
Collaborator

@jwrober jwrober left a comment

Choose a reason for hiding this comment

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

Works for me too.

@jwrober jwrober merged commit a392316 into longturn:master Oct 23, 2024
21 checks passed
@lmoureaux lmoureaux deleted the bugfix/minimap-out-of-sync branch October 26, 2024 17:37
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.

Minimap out of sync
3 participants