fix: 修复编辑流水线时流程图在动

This commit is contained in:
cp3hnu 2024-05-28 08:41:14 +08:00
parent 7e8935f471
commit afc2fbef5f
1 changed files with 9 additions and 1 deletions

View File

@ -51,8 +51,16 @@ const EditPipeline = () => {
return item.id === val.id;
});
data.nodes[index] = val;
const zoom = graph.getZoom();
// 0 0
const lastPoint = graph.getCanvasByPoint(0, 0);
graph.changeData(data);
graph.render();
graph.zoomTo(zoom);
// 0 0
const newPoint = graph.getCanvasByPoint(0, 0);
// ;
graph.translate(lastPoint.x - newPoint.x, lastPoint.y - newPoint.y);
}
};
const savePipeline = async (val) => {
@ -432,7 +440,7 @@ const EditPipeline = () => {
height: graphRef.current.clientHeight || '100%',
animate: false,
groupByTypes: false,
fitView: false,
fitView: true,
plugins: [contextMenu],
enabledStack: true,
modes: {