Skip to content

Conversation

mattcolman
Copy link

This fixes DOMElement for retina screens.

For example if you make your canvas retina aware like this:

var width = 900
var height = 400
var canvas = document.getElementById("canvas");
canvas.style.width = width
canvas.style.height = height
canvas.width = width * devicePixelRatio // value of devicePixelRatio can be seen in the code from BrowserDetect.getDeviceRatio()
canvas.height = height * devicePixelRatio

Then the Easel stage is rendered with crisp text and vector shapes on your retina screen, but DOMElement is positioned and scaled incorrectly.
This PR fixes that.

@kahwee
Copy link

kahwee commented Aug 31, 2016

I am encountering this problem too. Can this pull request be accepted?

@ndevr
Copy link

ndevr commented Oct 20, 2016

Can this pull request be accepted?

@kaushalc
Copy link

Is this available in the NextVersion ? I am also facing this issue.

@lannymcnie
Copy link
Member

Appreciate the PR -- but the implementation of an internal private class with one method is definitely non-standard. I would recommend just adding this as a method of DOMElement for now, and it might make sense to pull it out into a separate utility function/class (like utils/extend or any other single-method class in utils/).

@mattcolman
Copy link
Author

I'll take a look at cleaning this up

@mattcolman
Copy link
Author

@lannymcnie cleaned it up.
Finally worked out the formatting! 🤣

@kaushalc
Copy link

@lannymcnie I am facing this retina issue. I see there are some conflicts. Can this be resolved?

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.

5 participants