mirror of
https://github.com/konvajs/konva.git
synced 2025-12-17 18:01:15 +08:00
better toDataURL for shapes
This commit is contained in:
13
src/Node.js
13
src/Node.js
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user