Hello,
I would like to create a pill/stadium shape, like this :
It basically is a rectangle with text within, surounded by two semi circles on each side.
Until then I have been cheating by using 3 shapes (one rectangle and two circles with -50% margin).
I’m trying to fix this by creating my own shape using figures.js as an example, especially the Terminador shape.
It looks good, but the spacing of the shapes is still off. I think it as something to do with the spot1/spot2 parameters, but I’m unable to figure out the correct values for these.
Stadium(shape, w, h) {
var geo = new go.Geometry();
var fig = new go.PathFigure(.5 * w, 0, true);
geo.add(fig);
fig.add(new go.PathSegment(go.PathSegment.Arc, 270, 180, .75 * w, .5 * h, .5 * h, .5 * h));
fig.add(new go.PathSegment(go.PathSegment.Arc, 90, 180, .25 * w, .5 * h, .5 * h, .5 * h));
geo.spot1 = new go.Spot(.23, 0);
geo.spot2 = new go.Spot(.77, 1);
return geo;
}