Release package version 0.0.5
All checks were successful
CI / build (push) Successful in 28s

Fix node render
This commit is contained in:
Andrey Kernichniy 2026-03-16 01:40:02 +07:00
parent 6c2373d6ec
commit 7a95ae6ccc
6 changed files with 20 additions and 14 deletions

View file

@ -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();

View file

@ -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"
}
}