fix a bug that image is not translated to (dx, dy) when ctx.drawImage(img, dx, dy)

This commit is contained in:
fuzhen 2015-12-17 01:20:29 +08:00
parent 14e37d734c
commit d2e840c077

View File

@ -1075,13 +1075,10 @@
context.drawImage(image, sx, sy, sw, sh, 0, 0, dw, dh);
image = canvas;
}
svgImage.setAttribute("transform",["translate(",dx,",",dy,")"].join(""));
svgImage.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href",
image.nodeName === "CANVAS" ? image.toDataURL() : image.src);
parent.appendChild(svgImage);
this.__currentElement = svgImage;
this.translate(dx, dy);
this.__currentElement = currentElement;
}
};