mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-22 06:13:23 +08:00
Save sizes in the element
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user