Hello,
In the previous version of GoJs (2.X), I was able to draw a Shape which is out of the bounds. it was done on purpose because I have some parts of the shape which are designed as a decoration. In the current version of GoJs (We are currently using the 3.0.19 with Angular), I’m not able to do this anymore and I get the following error: ERROR Error: Geometry made with figure “NewDesignOnDemandCyclic” has bounds Rect(0,0,256,162) that are too large for the given size (256,146).
I understand why it’s restricted but is there a way to by pass this restriction ?
My current shape:
go.Shape.defineFigureGenerator('NewDesignOnDemandCyclic', (shape, w, h) => {
const x1 = 10;
const x2 = 27;
const y = 16;
const param1 = !!shape?.parameter1 ? shape.parameter1 : 5;
const param2 = !!shape?.parameter2 ? shape.parameter2 : 15;
const cpOffset1 = param1 * KAPPA;
const cpOffset2 = param2 * KAPPA;
return new go.Geometry().add(
new go.PathFigure(param1, 0, true)
.add(new go.PathSegment(go.SegmentType.Line, w - param2, 0))
.add(new go.PathSegment(go.SegmentType.Bezier, w, param2, w - cpOffset2, 0, w, cpOffset2))
.add(new go.PathSegment(go.SegmentType.Line, w, h - param2))
.add(new go.PathSegment(go.SegmentType.Bezier, w - param2, h, w, h - cpOffset2, w - cpOffset2, h))
.add(new go.PathSegment(go.SegmentType.Line, x2, h))
.add(new go.PathSegment(go.SegmentType.Line, x1, y + h))
.add(new go.PathSegment(go.SegmentType.Line, x1, h))
.add(new go.PathSegment(go.SegmentType.Line, param1, h))
.add(new go.PathSegment(go.SegmentType.Bezier, 0, h - param1, cpOffset1, h, 0, h - cpOffset1))
.add(new go.PathSegment(go.SegmentType.Line, 0, param1))
.add(new go.PathSegment(go.SegmentType.Bezier, param1, 0, 0, cpOffset1, cpOffset1, 0).close()),
);
});