-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix quasi-hangs when excessively large sizes are used in symbol preview icons for draw effects #45233
Merged
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
nyalldawson
commented
Sep 24, 2021
domi4484
approved these changes
Sep 24, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with this code but tried to give some feedback :)
constructed with no parameters set or not
has an invalid (default constructed) mapToPixel
yet NO scale is available, handle things semi-gracefully 1. Treat map units and meters at map units as millimeter values. (Any choice we make here is going to be wrong, but this at least allows us to show map unit based sizes as impacting on symbols in symbol preview icons) 2. Clamp the resultant size to a reasonable value range. Since a size of 2000 map units may be perfectly valid for one map and correspond to ~1mm, on another map this may translate to a size of 100 cm. We can't know what the expected scale range is for a pure size value, so we just limit the resultant size ranges to prevent massive sizes. Refs qgis#41149 - this prevents the map unit sizes for the effects from being treated as pixel sizes exceeding 10k sizes.
preview icons for draw effects This can quasi-hang the QGIS interface Fixes qgis#41149
nyalldawson
force-pushed
the
effect_hang
branch
from
September 26, 2021 02:19
f43ac57
to
72297dc
Compare
nirvn
approved these changes
Sep 27, 2021
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.
This PR implements so handling to prevent the quasi-hang descripted in #41149. Specifically we now have special logic in place to handle symbol sizes in map units when rendered in a context with no associated map scale (e.g. symbol preview icons).
Fixes #41149
Also fixes #42668