New nodes types added

This commit is contained in:
barsdeveloper
2022-12-28 19:02:29 +01:00
parent 0def4f7e48
commit 5036866b33
27 changed files with 636 additions and 254 deletions

View File

@@ -43,7 +43,11 @@ export default class Utility {
/** @param {HTMLElement} element */
static getScale(element) {
const scale = getComputedStyle(element).getPropertyValue("--ueb-scale")
// @ts-expect-error
const scale = element.blueprint
// @ts-expect-error
? element.blueprint.getScale()
: getComputedStyle(element).getPropertyValue("--ueb-scale")
return scale != "" ? parseFloat(scale) : 1
}
@@ -81,8 +85,8 @@ export default class Utility {
* @param {Number[]} viewportLocation
* @param {HTMLElement} movementElement
*/
static convertLocation(viewportLocation, movementElement) {
const scaleCorrection = 1 / Utility.getScale(movementElement)
static convertLocation(viewportLocation, movementElement, ignoreScale = false) {
const scaleCorrection = ignoreScale ? 1 : 1 / Utility.getScale(movementElement)
const targetOffset = movementElement.getBoundingClientRect()
let location = [
Math.round((viewportLocation[0] - targetOffset.x) * scaleCorrection),