-
-
Notifications
You must be signed in to change notification settings - Fork 233
Open
Description
I am trying to create a polygon from an existing Polygon object's points. However, when setting the vertices of the polygon, they are ignored, and a triangle is created.
The snippet of code I am using is presented below.
const polygonPoints = Object.values(polygon.points)
.map(point => ({
x: point.x ? point.x : 0.0,
y: point.y ? point.y : 0.0
}));
const poly = new draw2d.shape.basic.Polygon({
id: `${polygon.layer}-${polygon.datatype}-${k}`,
vertices: polygonPoints,
bgColor: "#FFF222",
color: "#777222",
alpha: .7,
//composite: cellId,
selectable: false,
draggable: false,
});
app.view.add(poly);
cellGroup.assignFigure(poly);What am I doing wrong?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels