generated from gxc-solutions/gxc-template-repo
Fix node render
This commit is contained in:
parent
6c2373d6ec
commit
7689eeae67
6 changed files with 19 additions and 13 deletions
|
|
@ -19,7 +19,7 @@ jobs:
|
|||
registry-url: ${{ vars.VERDACCIO_URL }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --registry ${{ vars.VERDACCIO_URL }}
|
||||
run: npm ci --registry ${{ vars.VERDACCIO_URL }} --legacy-peer-deps
|
||||
env:
|
||||
VERDACCIO_URL: ${{ vars.VERDACCIO_URL }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.VERDACCIO_TOKEN }}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ jobs:
|
|||
registry-url: ${{ vars.VERDACCIO_URL }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --registry ${{ vars.VERDACCIO_URL }}
|
||||
run: npm ci --registry ${{ vars.VERDACCIO_URL }} --legacy-peer-deps
|
||||
env:
|
||||
VERDACCIO_URL: ${{ vars.VERDACCIO_URL }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.VERDACCIO_TOKEN }}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
package-lock.json
generated
8
package-lock.json
generated
|
|
@ -9,7 +9,7 @@
|
|||
"version": "0.0.0",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@gxc-solutions/math": "^0.0.3",
|
||||
"@gxc-solutions/math": "^0.0.4",
|
||||
"@gxc-solutions/renderer-base": "^0.0.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
@ -696,9 +696,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@gxc-solutions/math": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://npm.gxc-solutions.ru/@gxc-solutions/math/-/math-0.0.3.tgz",
|
||||
"integrity": "sha512-B39/C/3YzfSbLgsf0sBpZILTSO8TIZVbh6tv3pXulG1qDL1tg41mLjp7M263MsC7ARzj7ME8WWsniBj0C4L+XA=="
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://npm.gxc-solutions.ru/@gxc-solutions/math/-/math-0.0.4.tgz",
|
||||
"integrity": "sha512-jV7q7IR6X9R37c2zaVwsTE4H2LlRlxKLqmkmGEkMDsq6/DBbBO26VC9uu2I98tUKybYgC++jSgA5OoUF0FGg1w=="
|
||||
},
|
||||
"node_modules/@gxc-solutions/renderer-base": {
|
||||
"version": "0.0.12",
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
"vite": "^7.3.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@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