better toDataURL for shapes

This commit is contained in:
Anton Lavrenov
2018-08-01 09:26:13 +07:00
parent 40416a0cee
commit 98d2d6ffe0
5 changed files with 55 additions and 9 deletions

View File

@@ -1582,17 +1582,16 @@
_toKonvaCanvas: function(config) {
config = config || {};
var box = this.getClientRect();
var stage = this.getStage(),
x = config.x || 0,
y = config.y || 0,
x = config.x || box.x,
y = config.y || box.y,
pixelRatio = config.pixelRatio || 1,
canvas = new Konva.SceneCanvas({
width:
config.width || this.getWidth() || (stage ? stage.getWidth() : 0),
width: config.width || box.width || (stage ? stage.getWidth() : 0),
height:
config.height ||
this.getHeight() ||
(stage ? stage.getHeight() : 0),
config.height || box.height || (stage ? stage.getHeight() : 0),
pixelRatio: pixelRatio
}),
context = canvas.getContext();