Skip to content

Commit

Permalink
Fix for converting polygon to rectangle.
Browse files Browse the repository at this point in the history
  • Loading branch information
caewok committed Jun 11, 2024
1 parent 52a5057 commit 2b99a5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## 0.3.4
Handle Wall, Edge classes in Draw.segment.
Add an internal PIXI.Point.invert that returns object, for non-keys.
Fix for test if can convert polygon to rectangle.

## 0.3.3
Switch to using TextureLoader.getTextureAlphaData.
Expand Down
4 changes: 2 additions & 2 deletions ClipperPaths.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export class ClipperPaths {
*/
static polygonToRectangle(polygon) {
const pts = polygon.points;
if ( !(polygon.isClosed && pts.length === 10)
|| !(!polygon.isClosed && pts.length === 8) ) return polygon;
if ( (polygon.isClosed && pts.length !== 10)
|| (!polygon.isClosed && pts.length !== 8) ) return polygon;

// Layout must be clockwise.
// Layout options:
Expand Down

0 comments on commit 2b99a5a

Please sign in to comment.