Save sizes in the element

This commit is contained in:
barsdeveloper
2022-12-07 19:43:04 +01:00
parent 9e8e25d832
commit 97d4b18347
9 changed files with 57 additions and 39 deletions

View File

@@ -48,12 +48,16 @@ export default class IDraggableElement extends IElement {
this.sizeY = -1
}
computeSizes() {
const bounding = this.getBoundingClientRect()
this.sizeX = bounding.width
this.sizeY = bounding.height
}
/** @param {Map} changedProperties */
firstUpdated(changedProperties) {
super.firstUpdated(changedProperties)
const boundaries = this.getBoundingClientRect()
this.sizeX = boundaries.width
this.sizeY = boundaries.height
this.computeSizes()
}
/** @param {Number[]} param0 */