I\'m trying out Paper.js for fun, but it seems I\'m already stuck at the very start.
Adding resize=\"true\"
to the canvas
tag is supposed to ma
Add the following CSS to your project:
<style type="text/css">
html,
body {
margin: 0;
overflow: hidden;
height: 100%;
}
/* Scale canvas with resize attribute to full size */
canvas[resize] {
width: 100%;
height: 100%;
}
</style>
I opened an issue for this on Github and it seems that this is a bug introduced in 0.9.22. @Skalkaz pointed me this question.
Here is the pending issue: https://github.com/paperjs/paper.js/issues/662.
You can also downgrade to 0.9.21 while waiting for a patch.
Another option is - if you are using set proportions (relative to the body) - to override paper's view:
var pageWidth = document.getElementsByTagName("BODY")[0].clientWidth
var pageHeight = document.getElementsByTagName("BODY")[0].clientHeight
view.size.width = pageWidth * myWidthScale
view.size.height = pageHeight * myHeightScale
center = new Point(width / 2, pageHeight / 2)
view.center = center