Skip to content

Commit

Permalink
Fix polygon points error
Browse files Browse the repository at this point in the history
  • Loading branch information
abigailalexander committed Mar 1, 2024
1 parent 27ae92c commit 903c5cf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ui/widgets/Polygon/polygon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ export const PolygonComponent = (
points,
rotationAngle = 0
} = props;
console.log(props);
//Loop over points and convert to string for svg
let coordinates = "";
points.values.forEach((point: Point) => {
coordinates += `${point.x},${point.y} `;
});
if (points) {
points.values.forEach((point: Point) => {
coordinates += `${point.x},${point.y} `;
});
}

return (
<svg
viewBox={`0 0 ${width} ${height}`}
Expand Down

0 comments on commit 903c5cf

Please sign in to comment.