-
Notifications
You must be signed in to change notification settings - Fork 42
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
Improve zoom #870
Merged
Merged
Improve zoom #870
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instead of reloading the tileset, draw the map on a canvas whose dimensions are adjusted to match the zoom level, and draw the canvas scaled. This results in a lower drawing quality for vector elements (city descriptions) but is much faster.
Reloading the tileset for every zoom change was never a good idea.
This is almost a joke because rendering is too slow to see more than a few frames, but it's also a motivation to speed it up.
lmoureaux
force-pushed
the
feature/better-zoom
branch
from
February 6, 2022 01:21
692471c
to
5aa669c
Compare
Other than those two issues, rest looks fine to me. |
Also make sure that it's inside the screen when on the left of the map, where it could previously be partially hidden. (info_tile is better known as the middle click tooltip.) See longturn#870.
Good catch, fixed both! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It no longer reloads the tileset every time, resulting in much faster zooms. Instead, zoom is handled at the mapview level by pretending that the canvas is smaller (or larger) than it really is, and scaling the drawn canvas afterwards. The main drawback is that drawing the map when zoomed out is rather slow. It is, however, quite fast when zoomed in.
City names and production aren't as sharp as they used to be when zooming. Text layers will need to be taken into account when designing the next-gen renderer.
This started as a test to see how far it could go but it turned out to be rather easy so I went ahead.
Closes #295.
Closes #296.
Closes #729.
Closes #864
(I think).
Test plan