Hello Stoyan,
it seems to me, that the values for Shape and Bounds are correct for all items. The SVG export fails if the following node with the following shape is present in the diagram:
internal class ShapeProcessOperator : myShapes
{
public static ElementTemplate[] elements =
new ElementTemplate[]
{
new LineTemplate(0, 0, 100, 0), new LineTemplate(100, 0, 100, 100), new LineTemplate(100, 100, 0, 100),
new LineTemplate(0, 100, 0, 0)
};
public static ElementTemplate[] textArea =
new ElementTemplate[]
{
new LineTemplate(5, 55, 5, 95), new LineTemplate(5, 95, 95, 95), new LineTemplate(95, 95, 95, 55),
new LineTemplate(95, 55, 5, 55)
};
public ShapeProcessOperator() : base(elements, textArea, "Operation")
{
bgColor = Color.LightGreen;
width = 40;
height = 10;
anchorPattern =
new AnchorPattern(
new AnchorPoint[]
{
new AnchorPoint(50, 0, true, false, MarkStyle.Circle, Color.Blue),
new AnchorPoint(50, 100, false, true, MarkStyle.Circle, Color.Green),
new AnchorPoint(100, 50, true, true, MarkStyle.Cross, Color.Red)
});
}
}
This node adjusts its anchorPattern while the user adds and removes links.
the following output is visible in the debugger:
draw string 'O0'
draw path
draw path
where O0 is the node with the ShapeProcessOperator - Shape.
Usually the following happens, if I use other shapes:
draw path
draw string 'B0'
draw path
draw string 'P0'
draw path
draw string 'E0'
draw path
draw string 'S0'
draw path
draw string 'E1'
draw path
draw string 'P1'
...and so on ...
Maybe a better hint for you. All these shapes also have no textarea defined. The text itself is a node. The shapes are defined like this:
internal class ShapeEnergy : myShapes
{
public static ElementTemplate[] elements =
new ElementTemplate[]
{
new LineTemplate(0, 50, 50, 0), new LineTemplate(50, 0, 100, 50), new LineTemplate(100, 50, 50, 100),
new LineTemplate(50, 100, 0, 50)
};
public ShapeEnergy()
: base(elements, "Energie")
{
bgColor = Color.LightBlue;
width = 10;
height = 10;
}
}
Best regards,
Alex