graflow: orientation as param

This commit is contained in:
STEINNI
2026-04-10 12:49:39 +00:00
parent 0cc03cf512
commit 90f45c2c8d
+7 -2
View File
@@ -264,7 +264,7 @@ class BZgraflow extends Buildoz{
}
}
childEl.autoPlace(this.currentOrientation, 60, 60)
childEl.autoPlace(this.currentOrientation, parseInt(this.getBZAttribute('gapx')) || 80, parseInt(this.getBZAttribute('gapy')) || 80)
}, { once:true })
// Fade out the current (host) graflow while the child scales up
@@ -442,11 +442,16 @@ class BZgraflow extends Buildoz{
this.addWire(link)
}
if(!this.currentOrientation) {
if(this.getBZAttribute('orientation')) {
this.currentOrientation = this.getBZAttribute('orientation')
} else {
const bb=this.getBoundingClientRect()
if(bb.width > bb.height) this.currentOrientation = 'horizontal'
else this.currentOrientation = 'vertical'
}
if(forceAutoplace) this.autoPlace(this.currentOrientation)
}
console.log('forceAutoplace', forceAutoplace, this.currentOrientation)
if(forceAutoplace) this.autoPlace(this.currentOrientation, parseInt(this.getBZAttribute('gapx')) || 80, parseInt(this.getBZAttribute('gapy')) || 80)
this.fireEvent('refreshed', { })
}