Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unlimited Polygon] Fix for creating concave polygons. #2009

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/slow-rules-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@khanacademy/perseus": patch
---

Fixing bug in creating concave shapes in unlimited polygons.
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ const UnlimitedPolygonGraph = (statefulProps: StatefulProps) => {

return (
<>
<Polyline
points={[...points]}
color="var(--movable-line-stroke-color)"
svgPolylineProps={{
strokeWidth: "var(--movable-line-stroke-weight)",
style: {fill: "transparent"},
}}
/>
{/* This rect is here to grab clicks so that new points can be added */}
{/* It's important because it stops mouse events from propogating
when dragging a points around */}
Expand All @@ -289,14 +297,6 @@ const UnlimitedPolygonGraph = (statefulProps: StatefulProps) => {
dispatch(actions.polygon.addPoint(graphCoordinates[0]));
}}
/>
<Polyline
points={[...points]}
color="var(--movable-line-stroke-color)"
svgPolylineProps={{
strokeWidth: "var(--movable-line-stroke-weight)",
style: {fill: "transparent"},
}}
/>
{coords.map((point, i) => (
<MovablePoint
key={i}
Expand Down
Loading