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 artefact in Qt caused by QRectF having a slightly wrong size #820

Merged
merged 1 commit into from
May 21, 2021

Conversation

kitchoi
Copy link
Contributor

@kitchoi kitchoi commented May 20, 2021

Closes #819

The issue is tested (manually) to affect these backends: qt4.image, qt4.celiagg and qt4.cairo.
For these backends, the GraphicsContext is defined to be slightly larger than the requested size:

gc = GraphicsContext(
(size[0] + 1, size[1] + 1),
base_pixel_scale=self.base_pixel_scale,
)

There is another QRectF defined for qt4.quartz, but I could not reproduce the issue there. For this backend, the GraphicsContext was defined without the plus-one:

gc = GraphicsContext(size)

Note that base_scale was not defined on the GraphicsContext for the cairo backend, and so it has to be added.

Apparently base_scale is not defined on the qpainter's GraphicsContext either, but that would be an orthogonal issue as #819 does not affect the qpainter backend.

@rahulporuri
Copy link
Contributor

rahulporuri commented May 21, 2021

@jwiggins any chance you can make time to review this PR today/monday? It looked good to me but i wanted a more experienced pair of eyes. The idea is to make a bug fix release ASAP once this is merged.

Copy link
Member

@jwiggins jwiggins left a comment

Choose a reason for hiding this comment

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

LGTM

@rahulporuri
Copy link
Contributor

rahulporuri commented May 21, 2021

@kitchoi i might be doing something wrong but have you/someone else on your team tested this fix on windows? I was in fact doing something wrong. Tested this locally on windows with the example code in #819 . Tested against image and celiagg backends. Works as expected.

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

LGTM

@kitchoi kitchoi merged commit 16f4f1d into master May 21, 2021
@rahulporuri rahulporuri deleted the fix-819-missing-pixels branch May 21, 2021 11:57
@kitchoi
Copy link
Contributor Author

kitchoi commented May 21, 2021

Thanks for the review and testing!

rahulporuri pushed a commit that referenced this pull request May 21, 2021
…ble 5.1.1 (#822)

* Fix artifact in Qt caused by QRectF having a slightly wrong size (#820)

* DOC : Update changelog in preparation for the release

	modified:   CHANGES.txt

Co-authored-by: Kit Choi <kitchoi@users.noreply.github.com>
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.

Missing pixels with Qt and image backend
3 participants