Copy link to clipboard
Copied
Yes to some extent, I calculate canvas width and height by multiplying with devicePixelRatio
var pRatio = window.devicePixelRatio || 1;
function handleMouseMove(evt) {
if (oldX) {
drawingCanvas.graphics.beginStroke(color)
.setStrokeStyle(size, "round")
.moveTo(oldX, oldY)
.lineTo(evt.stageX / pRatio, evt.stageY / pRatio);
stage.update();
}
oldX = evt.stageX / pRatio;
oldY = evt.stageY / pRatio;
}
Copy link to clipboard
Copied
it looks like it is due to Window: devicePixelRatio property
Copy link to clipboard
Copied
so, your question is answered?
Copy link to clipboard
Copied
Yes to some extent, I calculate canvas width and height by multiplying with devicePixelRatio
var pRatio = window.devicePixelRatio || 1;
function handleMouseMove(evt) {
if (oldX) {
drawingCanvas.graphics.beginStroke(color)
.setStrokeStyle(size, "round")
.moveTo(oldX, oldY)
.lineTo(evt.stageX / pRatio, evt.stageY / pRatio);
stage.update();
}
oldX = evt.stageX / pRatio;
oldY = evt.stageY / pRatio;
}
Copy link to clipboard
Copied
good to hear.