diff --git a/bzGraflow.js b/bzGraflow.js index 3682346..d29acbe 100644 --- a/bzGraflow.js +++ b/bzGraflow.js @@ -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) { - const bb=this.getBoundingClientRect() - if(bb.width > bb.height) this.currentOrientation = 'horizontal' - else this.currentOrientation = 'vertical' + 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', { }) }