Comment now drag nodes

This commit is contained in:
barsdeveloper
2022-12-11 21:58:40 +01:00
parent fffe3f7ad1
commit 16a00b409c
17 changed files with 208 additions and 40 deletions

View File

@@ -32,6 +32,14 @@ export default class CommentNodeTemplate extends IResizeableTemplate {
return this.element.querySelector(".ueb-node-top")
}
/** @param {Map} changedProperties */
willUpdate(changedProperties) {
super.willUpdate(changedProperties)
if (changedProperties.has("sizeX") || changedProperties.has("sizeY")) {
this.manageNodesBind()
}
}
render() {
return html`
<div class="ueb-node-border">
@@ -44,6 +52,18 @@ export default class CommentNodeTemplate extends IResizeableTemplate {
`
}
manageNodesBind() {
this.element.blueprint
.getNodes(false, [
this.element.topBoundary(),
this.element.rightBoundary(),
this.element.bottomBoundary(),
this.element.leftBoundary(),
])
.filter(node => !node.boundComments.includes(this.element))
.forEach(node => node.bindToComment(this.element))
}
/** @param {Number} value */
setSizeX(value) {
value = Math.round(value)