generated from gxc-solutions/gxc-template-repo
Support for render ImageBitmap
This commit is contained in:
parent
3c3b13e22f
commit
c0150f85fa
5 changed files with 40 additions and 19 deletions
|
|
@ -92,11 +92,20 @@ export class Canvas2DRenderer implements IRenderer {
|
|||
this._context.globalCompositeOperation = dn.blendMode as GlobalCompositeOperation;
|
||||
this._artist.setTransform(dn.transform);
|
||||
|
||||
this._artist.drawImage(
|
||||
dn.source,
|
||||
{ x: dn.rectangle.x, y: dn.rectangle.y },
|
||||
{ width: dn.rectangle.width, height: dn.rectangle.height },
|
||||
);
|
||||
if (dn.source instanceof HTMLImageElement) {
|
||||
this._artist.drawImage(
|
||||
dn.source,
|
||||
{ x: dn.rectangle.x, y: dn.rectangle.y },
|
||||
{ width: dn.rectangle.width, height: dn.rectangle.height },
|
||||
);
|
||||
} else if (dn.source instanceof ImageBitmap) {
|
||||
this._artist.drawImage2(
|
||||
dn.source,
|
||||
{ x: dn.rectangle.x, y: dn.rectangle.y },
|
||||
{ width: dn.rectangle.width, height: dn.rectangle.height },
|
||||
);
|
||||
}
|
||||
|
||||
this._context.restore();
|
||||
}
|
||||
if (isRectangleDrawObject(leaf)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue