graflow: orientation as param

This commit is contained in:
STEINNI
2026-04-10 12:49:39 +00:00
parent 0cc03cf512
commit 90f45c2c8d
+10 -5
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 }) }, { once:true })
// Fade out the current (host) graflow while the child scales up // Fade out the current (host) graflow while the child scales up
@@ -442,11 +442,16 @@ class BZgraflow extends Buildoz{
this.addWire(link) this.addWire(link)
} }
if(!this.currentOrientation) { if(!this.currentOrientation) {
const bb=this.getBoundingClientRect() if(this.getBZAttribute('orientation')) {
if(bb.width > bb.height) this.currentOrientation = 'horizontal' this.currentOrientation = this.getBZAttribute('orientation')
else this.currentOrientation = 'vertical' } 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', { }) this.fireEvent('refreshed', { })
} }