Skip to content

Commit

Permalink
[2640] Compute handle position on diagram conversion
Browse files Browse the repository at this point in the history
Bug: #2640
Signed-off-by: Guillaume Coutable <guillaume.coutable@obeo.fr>
  • Loading branch information
gcoutable authored and sbegaudeau committed Nov 28, 2023
1 parent 341ac44 commit 7c0a467
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ It uses our algorithm instead of elk.js to perform the arrange-all.
- https://github.com/eclipse-sirius/sirius-web/issues/2635[#2635] [diagram] Fix an error when switching between react flow representations.
- https://github.com/eclipse-sirius/sirius-web/issues/2581[#2581] [diagram] Fix an issue where nodes created by custom tool are always on the default position.
- https://github.com/eclipse-sirius/sirius-web/issues/2642[#2642] [diagram] Fix an issue where moving the viewport was slow.
- https://github.com/eclipse-sirius/sirius-web/issues/2640[#2640] [diagram] Compute the handle position on diagram conversion, which happens every time a diagram refresh payload is received.

=== New Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { GQLLabel, GQLLabelStyle } from '../graphql/subscription/labelFragment.t
import { GQLNode, GQLNodeStyle, GQLViewModifier } from '../graphql/subscription/nodeFragment.types';
import { Diagram, Label, NodeData } from '../renderer/DiagramRenderer.types';
import { MultiLabelEdgeData } from '../renderer/edge/MultiLabelEdge.types';
import { RawDiagram } from '../renderer/layout/layout.types';
import { layoutHandles } from '../renderer/layout/layoutHandles';
import { DiagramNodeType } from '../renderer/node/NodeTypes.types';
import { IConvertEngine, INodeConverterHandler } from './ConvertEngine.types';
import { IconLabelNodeConverterHandler } from './IconLabelNodeConverterHandler';
Expand Down Expand Up @@ -211,14 +213,20 @@ export const convertDiagram = (
};
});

const rawDiagram: RawDiagram = {
nodes,
edges,
};
layoutHandles(rawDiagram);

return {
metadata: {
id: gqlDiagram.id,
label: gqlDiagram.metadata.label,
kind: gqlDiagram.metadata.kind,
targetObjectId: gqlDiagram.targetObjectId,
},
nodes,
edges,
nodes: rawDiagram.nodes,
edges: rawDiagram.edges,
};
};

0 comments on commit 7c0a467

Please sign in to comment.