Skip to content

Commit

Permalink
fix: correct offset issue with custom arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
yvonneyx committed Oct 29, 2024
1 parent 1cc1611 commit dd6235d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/g6/__tests__/demos/element-edge-custom-arrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ export const elementEdgeCustomArrow: TestCase = async (context) => {
source: 'node1',
target: 'node2',
style: {
endArrowD: 'M0,0 L10,4 L14,14 L18,4 L28,0 L18,-4 L14,-14 L10,-4 Z',
endArrowOffset: 28,
endArrowD: 'M-14,0 L-4,-4 L0,-14 L4,-4 L14,0 L4,4 L0,14 L-4,4 Z',
endArrowOffset: 14,
},
},
{
id: 'custom-arrow-2',
source: 'node3',
target: 'node4',
style: {
endArrowD: 'M 3,-5 L 3,5 L 15,10 L 15,-10 Z',
endArrowD: 'M -6,-5 L -6,5 L 6,10 L 6,-10 Z',
endArrowOffset: 20,
},
},
Expand Down Expand Up @@ -53,6 +53,7 @@ export const elementEdgeCustomArrow: TestCase = async (context) => {
type: 'grid',
cols: 2,
},
behaviors: ['drag-element'],
});

await graph.render();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const data = {
source: 'node1',
target: 'node2',
style: {
endArrowD: 'M0,0 L10,4 L14,14 L18,4 L28,0 L18,-4 L14,-14 L10,-4 Z',
endArrowD: 'M-14,0 L-4,-4 L0,-14 L4,-4 L14,0 L4,4 L0,14 L-4,4 Z',
endArrowOffset: 14,
},
},
Expand Down

0 comments on commit dd6235d

Please sign in to comment.