|
|
@ -148,14 +148,16 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function draw(domNode, options) {
|
|
|
|
function draw(domNode, options) {
|
|
|
|
return toSvg(domNode, options)
|
|
|
|
return (
|
|
|
|
.then(util.makeImage)
|
|
|
|
toSvg(domNode, options)
|
|
|
|
.then(util.delay(100))
|
|
|
|
.then(util.makeImage)
|
|
|
|
.then(function (image) {
|
|
|
|
// .then(util.delay(100))
|
|
|
|
var canvas = newCanvas(domNode)
|
|
|
|
.then(function (image) {
|
|
|
|
canvas.getContext('2d').drawImage(image, 0, 0)
|
|
|
|
var canvas = newCanvas(domNode)
|
|
|
|
return canvas
|
|
|
|
canvas.getContext('2d').drawImage(image, 0, 0)
|
|
|
|
})
|
|
|
|
return canvas
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
function newCanvas(domNode) {
|
|
|
|
function newCanvas(domNode) {
|
|
|
|
var canvas = document.createElement('canvas')
|
|
|
|
var canvas = document.createElement('canvas')
|
|
|
|