Small refactoring, several tests added

This commit is contained in:
barsdeveloper
2023-01-26 22:02:43 +01:00
parent abc19f831a
commit 60b477ac62
24 changed files with 594 additions and 68 deletions

View File

@@ -69,8 +69,10 @@ export default class BlueprintTemplate extends ITemplate {
const bounding = this.viewportElement.getBoundingClientRect()
this.viewportSize[0] = bounding.width
this.viewportSize[1] = bounding.height
this.blueprint.requestUpdate()
this.blueprint.updateComplete.then(() => this.centerContentInViewport())
if (this.blueprint.nodes.length > 0) {
this.blueprint.requestUpdate()
this.blueprint.updateComplete.then(() => this.centerContentInViewport())
}
}
cleanup() {
@@ -186,6 +188,10 @@ export default class BlueprintTemplate extends ITemplate {
))
}
getCopyInputObject() {
return this.getInputObject(Copy)
}
/**
* @param {Number} x
* @param {Number} y