mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-28 03:24:43 +08:00
Comment now drag nodes
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user