Skip to content

Commit a22b526

Browse files
committed
round and remove duplicates after scale
1 parent e2c1a4d commit a22b526

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@ export default function(paths, point, {
1616
point = { X: point.x * scale, Y: point.y * scale };
1717

1818
// create clipper shape
19-
const shape = new Shape(paths, false, true, true, true)
19+
const shape = new Shape(paths, false, true)
2020
// scale up for precision
2121
.scaleUp(scale)
22+
// cleanup shape
23+
.round()
24+
.removeDuplicates()
2225
// convert lines to polygons (this gives lines width)
2326
.offset(lineWidth, { jointType: 'jtMiter', endType: 'etOpenSquare', miterLimit })
2427
// union all overlapping paths

0 commit comments

Comments
 (0)