graflowEditor: fixed gapy bug , graflow: update flow coords after move
This commit is contained in:
@@ -41,7 +41,7 @@ class BZgrafloweditor extends Buildoz{
|
|||||||
this.graflow.setAttribute('wiretype', "bezier")
|
this.graflow.setAttribute('wiretype', "bezier")
|
||||||
this.graflow.setAttribute('tension', "30")
|
this.graflow.setAttribute('tension', "30")
|
||||||
this.graflow.setAttribute('gapx', "80")
|
this.graflow.setAttribute('gapx', "80")
|
||||||
this.graflow.setAttribute('gapy', "20")
|
this.graflow.setAttribute('gapy', "80")
|
||||||
this.graflow.addEventListener('bz:graflow:domConnected', this.setupDropZone.bind(this))
|
this.graflow.addEventListener('bz:graflow:domConnected', this.setupDropZone.bind(this))
|
||||||
this.graflow.append(this.slidePane)
|
this.graflow.append(this.slidePane)
|
||||||
this.mainContainer.append(this.graflow)
|
this.mainContainer.append(this.graflow)
|
||||||
|
|||||||
@@ -699,7 +699,6 @@ class BZgraflow extends Buildoz{
|
|||||||
layerWidths.push(totWidth)
|
layerWidths.push(totWidth)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// If any long-links, create placeholders for skipped layers
|
// If any long-links, create placeholders for skipped layers
|
||||||
this._virtualLinks = new Map()
|
this._virtualLinks = new Map()
|
||||||
this.flow.longLinks = this.findLongLinks(links)
|
this.flow.longLinks = this.findLongLinks(links)
|
||||||
@@ -751,6 +750,7 @@ class BZgraflow extends Buildoz{
|
|||||||
y = ((maxHeight - layerHeights[idx]) / 2) + gapy
|
y = ((maxHeight - layerHeights[idx]) / 2) + gapy
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
console.log('======>',gapy, y)
|
||||||
for(const nid of layer){
|
for(const nid of layer){
|
||||||
let placedY
|
let placedY
|
||||||
if(!nid.startsWith('longLinkPlaceHolder_')) {
|
if(!nid.startsWith('longLinkPlaceHolder_')) {
|
||||||
@@ -974,6 +974,12 @@ class BZgraflow extends Buildoz{
|
|||||||
|
|
||||||
if(p < 1) requestAnimationFrame(frame.bind(this))
|
if(p < 1) requestAnimationFrame(frame.bind(this))
|
||||||
else{
|
else{
|
||||||
|
const flowNode = this.flow?.nodes?.find(n => n.id === nid)
|
||||||
|
if(flowNode) {
|
||||||
|
if(!flowNode.coords) flowNode.coords = {}
|
||||||
|
flowNode.coords.x = x
|
||||||
|
flowNode.coords.y = y
|
||||||
|
}
|
||||||
this.fireEvent('nodeMoved', { nid, x, y })
|
this.fireEvent('nodeMoved', { nid, x, y })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user