Hi,
I added Adornment
to my link and set its layerName
to Background
as wanted to have Label on the link which is not passed through by the link when selected.
But the issue is, after adding selectionAdornmentTemplate
property to my linkTemplate, on selecting the link, UndoManager registers it with the name “Layout”.
I want to avoid registering link selection on Undo/Redo.
My linkTemplate:
$(
go.Link,
{
relinkableFrom: true,
relinkableTo: true,
reshapable: true,
resegmentable: true,
selectionAdornmentTemplate: $(
go.Adornment,
{ layerName: 'Background' },
$(go.Shape, { isPanelMain: true, stroke: sassVariables['colors-startEndNodeFill'], strokeWidth: 3.5 })
),
},
{
routing: go.Link.AvoidsNodes,
adjusting: go.Link.End,
curve: go.Link.JumpOver,
corner: 5,
toShortLength: 4,
},
// link segments
new go.Binding('points').makeTwoWay(),
// link path shape
$(go.Shape, linkPathStyle()),
// link arrowhead
$(go.Shape, linkArrowheadStyle()),
linkLabelTemplate: $(
go.Panel,
'Auto', // this whole Panel is a link label
$(
go.Shape,
'Rectangle',
new go.Binding('fill', linkLabelBackgroundBinding),
new go.Binding('stroke', linkLabelBackgroundBinding)
),
$(go.TextBlock, new go.Binding('text', 'label'))
) // Link label
)
Thanks for any help!