Comments selectable by header only, links fixes

This commit is contained in:
barsdeveloper
2022-12-16 22:36:31 +01:00
parent 69d274e9cf
commit 479db1e987
10 changed files with 121 additions and 31 deletions

View File

@@ -11,6 +11,7 @@ import LinearColorEntity from "../entity/LinearColorEntity"
export default class CommentNodeTemplate extends IResizeableTemplate {
#color = LinearColorEntity.getWhite()
#selectableAreaHeight = 0
/** @param {NodeElement} element */
constructed(element) {
@@ -44,6 +45,13 @@ export default class CommentNodeTemplate extends IResizeableTemplate {
`
}
/** @param {Map} changedProperties */
firstUpdated(changedProperties) {
super.firstUpdated(changedProperties)
const bounding = this.getDraggableElement().getBoundingClientRect()
this.#selectableAreaHeight = bounding.height
}
manageNodesBind() {
let nodes = this.element.blueprint.getNodes()
for (let node of nodes) {
@@ -83,4 +91,22 @@ export default class CommentNodeTemplate extends IResizeableTemplate {
endResize() {
this.manageNodesBind()
}
topBoundary(justSelectableArea = false) {
return this.element.locationY
}
rightBoundary(justSelectableArea = false) {
return this.element.locationX + this.element.sizeX
}
bottomBoundary(justSelectableArea = false) {
return justSelectableArea
? this.element.locationY + this.#selectableAreaHeight
: super.bottomBoundary()
}
leftBoundary(justSelectableArea = false) {
return this.element.locationX
}
}