when I do
paper.setup(imageCanvas);
the width and height of imageCanvas changes from 2048 * 1536 to 681 * 511 I tried to to understand the code by debugging it and
_setViewSize: function(size) {
var element = this._element,
pixelRatio = this._pixelRatio,
width = size.width,
height = size.height;
element.width = width * pixelRatio;
element.height = height * pixelRatio;
if (pixelRatio !== 1) {
if (!PaperScope.hasAttribute(element, 'resize')) {
var style = element.style;
style.width = width + 'px';
style.height = height + 'px';
}
this._context.scale(pixelRatio, pixelRatio);
}
},
is the area where it changes the size of the element by multiplying it by pixelRatio, which is somehow 0.3330000042915344.
Can anybody explain why paperjs would try to change the dimensions?
This is hilarious!
I figured out why the pixelRatio is 0.333... it is because I zoomed out the browser and hence it was changing the canvas size.