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 updating retinaScale #6971

Merged
merged 2 commits into from
Jan 18, 2020
Merged

Fix updating retinaScale #6971

merged 2 commits into from
Jan 18, 2020

Conversation

kurkle
Copy link
Member

@kurkle kurkle commented Jan 17, 2020

ctx.scale applies on top of previous scaling.

Using ctx.setTransform instead.
Not bailing out if pixelRatio === 1, because it could have been different previously. Also makes the behavior consistent.

benmccann
benmccann previously approved these changes Jan 17, 2020
var height = chart.height;
var width = chart.width;
const pixelRatio = chart.currentDevicePixelRatio = forceRatio || (typeof window !== 'undefined' && window.devicePixelRatio) || 1;
const canvas = chart.canvas;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe destructure here:
const {canvas, width, height} = chart;

@etimberg etimberg added this to the Version 3.0 milestone Jan 18, 2020
@etimberg etimberg merged commit ddd1c43 into chartjs:master Jan 18, 2020
@kurkle kurkle deleted the dpr branch February 19, 2020 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants