Performance improvement

This commit is contained in:
barsdeveloper
2022-10-17 22:32:25 +02:00
parent 192f2a4c11
commit e8a35c81d0
17 changed files with 215 additions and 47 deletions

View File

@@ -12,16 +12,16 @@ export default class IFromToPositionedTemplate extends ITemplate {
update(changedProperties) {
super.update(changedProperties)
if (changedProperties.has("initialPositionX")) {
this.element.style.setProperty("--ueb-from-x", `${this.element.initialPositionX}`)
this.element.style.setProperty("--ueb-from-x", `${Math.round(this.element.initialPositionX)}`)
}
if (changedProperties.has("initialPositionY")) {
this.element.style.setProperty("--ueb-from-y", `${this.element.initialPositionY}`)
this.element.style.setProperty("--ueb-from-y", `${Math.round(this.element.initialPositionY)}`)
}
if (changedProperties.has("finaPositionX")) {
this.element.style.setProperty("--ueb-to-x", `${this.element.finaPositionX}`)
this.element.style.setProperty("--ueb-to-x", `${Math.round(this.element.finaPositionX)}`)
}
if (changedProperties.has("finaPositionY")) {
this.element.style.setProperty("--ueb-to-y", `${this.element.finaPositionY}`)
this.element.style.setProperty("--ueb-to-y", `${Math.round(this.element.finaPositionY)}`)
}
}