Minor refactoring

This commit is contained in:
barsdeveloper
2025-01-25 01:41:32 +02:00
parent dfa402707c
commit 1d9a88125e
13 changed files with 176 additions and 104 deletions

View File

@@ -172,9 +172,12 @@ export default class PinTemplate extends ITemplate {
}
getLinkLocation() {
const rect = this.iconElement.getBoundingClientRect()
const rect = (this.#iconElement ?? this.element).getBoundingClientRect()
/** @type {[Number, Number]} */
const boundingLocation = [this.element.isInputVisually() ? rect.left : rect.right + 1, (rect.top + rect.bottom) / 2]
const boundingLocation = [
this.element.isInputVisually() ? rect.left : rect.right + 1,
(rect.top + rect.bottom) / 2
]
const location = Utility.convertLocation(boundingLocation, this.blueprint.template.gridElement)
return this.blueprint.compensateTranslation(location[0], location[1])
}