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

Fixed repainting of cached images #558

Merged
merged 1 commit into from
Jun 20, 2022
Merged

Fixed repainting of cached images #558

merged 1 commit into from
Jun 20, 2022

Conversation

tsujan
Copy link
Member

@tsujan tsujan commented Jun 9, 2022

Previously, the cached pixmap was drawn inside the repaint rectangle. That was wrong because there's no guarantee that the repaint rectangle is as big as the cached pixmap (e.g., it isn't so when the toolbar extension popup covers a part of the image and slides back). Therefore, visual glitches were imminent in special cases.

This patch draws the cached pixmap inside its corresponding cache rectangle, so that the image is always repainted correctly. The paint clipping is done by Qt automatically, as QPaintEvent's doc explains.

Fixes #557

Previously, the cached pixmap was drawn inside the repaint rectangle. That was wrong because there's no guarantee that the repaint rectangle is as big as the cached pixmap (e.g., it isn't so when the toolbar extension popup covers a part of the image and slides back). Therefore, visual glitches were imminent in special cases.

This patch draws the cached pixmap inside its corresponding cache rectangle, so that the image is always repainted correctly. The paint clipping is done by Qt automatically, as QPaintEvent's doc explains.

Fixes #557
@tsujan
Copy link
Member Author

tsujan commented Jun 19, 2022

Any objection to merging?

@tsujan tsujan merged commit a526f1b into master Jun 20, 2022
@tsujan tsujan deleted the fixed_cache_painting branch June 20, 2022 20:44
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.

Top of image gets corrupted when toolbar extension popup slides back
1 participant