simplify getOutline function

This commit is contained in:
casperlamboo 2017-05-16 10:44:48 +02:00
parent c9cbd1fc49
commit c5a6f3cf14

View File

@ -5,17 +5,10 @@ export default class {
this.parts = []; this.parts = [];
} }
getOutline() { getOutline() {
const outLines = new Shape([], true); return this.parts.reduce((shape, part) => {
if (part.outerLine) shape.join(part.outerLine);
for (let i = 0; i < this.parts.length; i ++) { return shape;
const part = this.parts[i]; }, new Shape([], true));
if (part.shape.closed) {
outLines.join(this.parts[i].outerLine);
}
}
return outLines;
} }
add(shape) { add(shape) {
const part = { shape }; const part = { shape };