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

UI: Fix marker generation on HiDPI displays #54

Merged
merged 1 commit into from Aug 25, 2018

Conversation

filiperinaldi
Copy link
Contributor

This patch fixes the markers generation when using HiDPI displays. The
previous implementation was mixing real pixels and device independent
pixels values when calculating sizes and spacing.

This patch fixes the markers generation when using HiDPI displays. The
previous implementation was mixing real pixels and device independent
pixels values when calculating sizes and spacing.
@filiperinaldi
Copy link
Contributor Author

Fixes issue #51


QSize pixmapSize(ofs + pw, ph);
const unsigned int mark_spacing = 2; // Space between markers in pixels
Copy link
Owner

Choose a reason for hiding this comment

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

It is highly preferable to avoid mixing functional changes and whitespace or code cleanup (like changing variable names without changing their use).

/*
* Return the device pixel ratio
*/
const qreal ListViewDelegate::dpr(void) const {
Copy link
Owner

Choose a reason for hiding this comment

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

This does not need to be a private method on the class. It can very well be a local function and releave a tiny bit of the burden from the compiler.

@tibirna tibirna merged commit b654818 into tibirna:master Aug 25, 2018
@filiperinaldi filiperinaldi deleted the fix_markers-hidpi branch August 31, 2018 21:29
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.

None yet

2 participants