This commit is contained in:
Casper Lamboo 2021-05-19 19:59:54 +02:00
parent 31e9ec735f
commit 87b6e9851b
5 changed files with 6 additions and 6 deletions

View File

@ -159,7 +159,7 @@ export default class BaseTool extends EventGroup {
} else { } else {
return clipperShape return clipperShape
.offset(margin, { joinType: 'jtSquare', endType: 'etOpenButt' }) .offset(margin, { joinType: 'jtSquare', endType: 'etOpenButt' })
.seperateShapes() .separateShapes()
.some(_clipperShape => _clipperShape.pointInShape(position, true, true)); .some(_clipperShape => _clipperShape.pointInShape(position, true, true));
} }
}); });

View File

@ -65,7 +65,7 @@ export default function (state, action) {
unionShape = unionShape.union(shape); unionShape = unionShape.union(shape);
} }
const unionShapes = unionShape.scaleDown(CLIPPER_PRECISION).seperateShapes().map(shape => { const unionShapes = unionShape.scaleDown(CLIPPER_PRECISION).separateShapes().map(shape => {
shape = shape shape = shape
.removeDuplicates() .removeDuplicates()
.mapToLower() .mapToLower()

View File

@ -185,7 +185,7 @@ function shapeToPointsRaw(shapeData) {
if (shapeData.fill) { if (shapeData.fill) {
new ClipperShape([points, ...holes], true, true, false, false) new ClipperShape([points, ...holes], true, true, false, false)
.simplify('pftEvenOdd') .simplify('pftEvenOdd')
.seperateShapes() .separateShapes()
.forEach(shape => { .forEach(shape => {
const [points, ...holes] = shape const [points, ...holes] = shape
.mapToLower() .mapToLower()
@ -236,7 +236,7 @@ function shapeToPointsCorneredRaw(shapeData) {
roundPrecision: 0.25 roundPrecision: 0.25
}) })
.scaleDown(CLIPPER_PRECISION) .scaleDown(CLIPPER_PRECISION)
.seperateShapes() .separateShapes()
.forEach(shape => { .forEach(shape => {
let [points, ...holes] = shape let [points, ...holes] = shape
.mapToLower() .mapToLower()

View File

@ -67,7 +67,7 @@ export default function subtractShapeFromState(state, differenceShape, tool, opt
// Returns two dimentional array, with per shape an array of paths. // Returns two dimentional array, with per shape an array of paths.
// The first item of each path is the outline, the others are holes, if there are any. // The first item of each path is the outline, the others are holes, if there are any.
let resultShapes = resultShape let resultShapes = resultShape
.seperateShapes() .separateShapes()
.map(resultPaths => { // go through all created shapes (1 shape can be a combination of outline+holes) .map(resultPaths => { // go through all created shapes (1 shape can be a combination of outline+holes)
if (scale !== undefined) resultPaths.scaleDown(scale); if (scale !== undefined) resultPaths.scaleDown(scale);
resultPaths = resultPaths resultPaths = resultPaths

View File

@ -24,7 +24,7 @@ export function createTextRaw(text, size, precision, family, style, weight) {
const shapes = new ClipperShape(pathsOffset, true, true, false) const shapes = new ClipperShape(pathsOffset, true, true, false)
.fixOrientation() .fixOrientation()
.seperateShapes() .separateShapes()
.map(shape => shape.mapToLower()) .map(shape => shape.mapToLower())
.map(shapeToVectorShape); .map(shapeToVectorShape);