better autofit signature

This commit is contained in:
STEINNI
2026-07-30 12:24:26 +00:00
parent 43cd6a85b1
commit 9b0cb2582e
+3 -3
View File
@@ -514,8 +514,8 @@ class BZgraflow extends Buildoz{
const autofitTween = (autofitAttr !== null && autofitAttr !== '' && !Number.isNaN(parseFloat(autofitAttr))) const autofitTween = (autofitAttr !== null && autofitAttr !== '' && !Number.isNaN(parseFloat(autofitAttr)))
? parseFloat(autofitAttr) ? parseFloat(autofitAttr)
: undefined : undefined
if(this._canRunAutoPlace()) this.autofit(100, autofitTween) if(this._canRunAutoPlace()) this.autofit(autofitTween)
else this._scheduleLayoutWhenReady(() => this.autofit(100, autofitTween)) else this._scheduleLayoutWhenReady(() => this.autofit(autofitTween))
} }
} }
const onLayoutComplete = () => { const onLayoutComplete = () => {
@@ -1332,7 +1332,7 @@ class BZgraflow extends Buildoz{
return(crossLayerLinks) return(crossLayerLinks)
} }
autofit(percent=100, tween = 0){ autofit(tween = 0, percent=100){
const outwidth = Math.max(this.clientWidth, 1) const outwidth = Math.max(this.clientWidth, 1)
const outheight = Math.max(this.clientHeight, 1) const outheight = Math.max(this.clientHeight, 1)
let inwidth = this.nodesContainer.scrollWidth let inwidth = this.nodesContainer.scrollWidth