mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-03-16 22:10:32 +00:00
Fix the wrapper (#4554)
This commit is contained in:
parent
2a7e6919f8
commit
38fcf8e274
2 changed files with 8 additions and 2 deletions
|
|
@ -1762,11 +1762,11 @@
|
|||
|
||||
if (fabric.isLikelyNode) {
|
||||
fabric.StaticCanvas.prototype.createPNGStream = function() {
|
||||
var impl = fabric.jsdomImplForWrapper(this.lowerCanvasEl);
|
||||
var impl = fabric.util.getNodeCanvas(this.lowerCanvasEl);
|
||||
return impl && impl.createPNGStream();
|
||||
};
|
||||
fabric.StaticCanvas.prototype.createJPEGStream = function(opts) {
|
||||
var impl = fabric.jsdomImplForWrapper(this.lowerCanvasEl);
|
||||
var impl = fabric.util.getNodeCanvas(this.lowerCanvasEl);
|
||||
return impl && impl.createJPEGStream(opts);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,6 +288,11 @@
|
|||
fabric.util.getScript = getScript;
|
||||
})();
|
||||
|
||||
function getNodeCanvas(element) {
|
||||
var impl = fabric.jsdomImplForWrapper(element);
|
||||
return impl._canvas || impl._image;
|
||||
};
|
||||
|
||||
fabric.util.getById = getById;
|
||||
fabric.util.toArray = toArray;
|
||||
fabric.util.makeElement = makeElement;
|
||||
|
|
@ -296,5 +301,6 @@
|
|||
fabric.util.getScrollLeftTop = getScrollLeftTop;
|
||||
fabric.util.getElementOffset = getElementOffset;
|
||||
fabric.util.getElementStyle = getElementStyle;
|
||||
fabric.util.getNodeCanvas = getNodeCanvas;
|
||||
|
||||
})();
|
||||
|
|
|
|||
Loading…
Reference in a new issue