mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
added counter pixel ratio method so that drawings aren't double scaled when using toDataUrl and toImage
This commit is contained in:
@@ -187,6 +187,13 @@
|
||||
if(pixelRatio !== 1) {
|
||||
this.getContext().scale(pixelRatio, pixelRatio);
|
||||
}
|
||||
},
|
||||
_counterPixelRatio: function() {
|
||||
var pixelRatio = Kinetic.Canvas.pixelRatio;
|
||||
if(pixelRatio !== 1) {
|
||||
pixelRatio = 1 / pixelRatio;
|
||||
this.getContext().scale(pixelRatio, pixelRatio);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user