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

Fix quasi-hangs when excessively large sizes are used in symbol preview icons for draw effects #45233

Merged
merged 10 commits into from
Sep 27, 2021

Conversation

nyalldawson
Copy link
Collaborator

@nyalldawson nyalldawson commented Sep 24, 2021

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

@github-actions github-actions bot added this to the 3.22.0 milestone Sep 24, 2021
Copy link
Contributor

@domi4484 domi4484 left a 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 :)

src/core/effects/qgsimageoperation.cpp Show resolved Hide resolved
src/core/effects/qgsshadoweffect.cpp Outdated Show resolved Hide resolved
src/core/qgsmaptopixel.h Show resolved Hide resolved
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants