Skip to content

window.devicePixelRatio scaling issue #16

@dragoncoder047

Description

@dragoncoder047

just figured this out now:

canvas.width = (canvas.parentElement.clientWidth - 10) * ratio;
canvas.height = (canvas.parentElement.clientHeight - 10) * ratio;

if window.devicePixelRatio is >1 (as it is on my macbook's screen) the canvas element will wind up going off the side and bottom of the screen

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions