generated from gxc-solutions/gxc-template-repo
Fix node render
This commit is contained in:
parent
6c2373d6ec
commit
7a95ae6ccc
6 changed files with 20 additions and 14 deletions
|
|
@ -50,17 +50,23 @@ export class Canvas2DRenderer implements IRenderer {
|
|||
}
|
||||
|
||||
renderNode(drawNode: IDrawNode) {
|
||||
this.drawNode(drawNode);
|
||||
drawNode.children.forEach((leaf) => {
|
||||
if (isDrawNode(leaf)) {
|
||||
this._artist.setTransform(leaf.transform);
|
||||
this._context.save();
|
||||
this.renderNode(leaf);
|
||||
this._context.restore();
|
||||
this.drawNode(leaf);
|
||||
} else {
|
||||
this.drawLeaf(leaf as DrawLeafs);
|
||||
}
|
||||
this.drawLeaf(leaf as DrawLeafs);
|
||||
});
|
||||
}
|
||||
|
||||
private drawNode(node: IDrawNode) {
|
||||
this._artist.setTransform(node.transform);
|
||||
this._context.save();
|
||||
this.renderNode(node);
|
||||
this._context.restore();
|
||||
}
|
||||
|
||||
private drawLeaf(leaf: DrawLeafs) {
|
||||
if (isEllipseDrawObject(leaf)) {
|
||||
this._context.save();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@gxc-solutions/renderer-canvas-2d",
|
||||
"version": "0.0.5",
|
||||
"version": "0.0.6",
|
||||
"main": "index.js",
|
||||
"author": "GXC Solutions",
|
||||
"publishConfig": {
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"registry": "https://npm.gxc-solutions.ru"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@gxc-solutions/math": "^0.0.3",
|
||||
"@gxc-solutions/math": "^0.0.4",
|
||||
"@gxc-solutions/renderer-base": "^0.0.12"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue