Scrollbars on diagram when adornments on node

Hello,

I have nodes with selection adornments (supplied using node.selectionAdornmentTemplate.add).

The scrollbars in the diagrammer show up properly when it gets bigger than the viewport. However, when the adornments are shown, they do not seem to be taken into account when determining the required size, so some of these adornments are only partially visible when we get to the extremities of the diagram.

Is there any way to improve on that?

Thanks in advance,
Marc.

I don’t know if it is wise to be modifying the shared Diagram.nodeSelectionAdornmentTemplate, if that is what you are doing. Node.selectionAdornmentTemplate is normally null, but perhaps you have set it yourself so that it is OK in your app to modify that template.

Yes, it is true that Adornments are not part of the Diagram.documentBounds. If they were you might get very annoying behavior when modifying the adornment for a node, as things scroll (or zoom!) automatically.

If your custom adornments are a fixed size, it might be easiest for you to increase the Diagram.padding to cause the computed Diagram.documentBounds to include such areas, whether there were such adornments present along the edge or not.

OK I’ll see what I can do with the Diagram.padding.

I am not modifying the shared Diagram.nodeSelectionAdornmentTemplate. I am merely adding stuff to the part’s selectionAdornmentTemplate, just like this is done at http://www.gojs.net/latest/samples/stateChart.html. I presume this is accepted.

Thanks,
Marc.

Sure, that’s OK. I thought you were implying that you were modifying the template dynamically. You can certainly construct the template in any manner you like. I just thought it might be unsupported/undefined if you modify it after setting Part.selectionAdornmentTemplate.