mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-11 13:38:53 -04:00
Simplify addJoin().
This commit is contained in:
parent
8f7deef61c
commit
a4b37a6278
1 changed files with 22 additions and 27 deletions
|
@ -1098,14 +1098,11 @@ var Path = this.Path = PathItem.extend({
|
||||||
if (join === 'round' || handleIn && handleOut) {
|
if (join === 'round' || handleIn && handleOut) {
|
||||||
bounds = bounds.unite(joinBounds.setCenter(matrix
|
bounds = bounds.unite(joinBounds.setCenter(matrix
|
||||||
? matrix.transform(segment._point) : segment._point));
|
? matrix.transform(segment._point) : segment._point));
|
||||||
} else {
|
} else if (join == 'bevel') {
|
||||||
switch (join) {
|
|
||||||
case 'bevel':
|
|
||||||
var curve = segment.getCurve();
|
var curve = segment.getCurve();
|
||||||
addBevelJoin(curve, 0);
|
addBevelJoin(curve, 0);
|
||||||
addBevelJoin(curve.getPrevious(), 1);
|
addBevelJoin(curve.getPrevious(), 1);
|
||||||
break;
|
} else if (join == 'miter') {
|
||||||
case 'miter':
|
|
||||||
var curve2 = segment.getCurve(),
|
var curve2 = segment.getCurve(),
|
||||||
curve1 = curve2.getPrevious(),
|
curve1 = curve2.getPrevious(),
|
||||||
point = curve2.getPoint(0),
|
point = curve2.getPoint(0),
|
||||||
|
@ -1124,8 +1121,6 @@ var Path = this.Path = PathItem.extend({
|
||||||
} else {
|
} else {
|
||||||
add(corner);
|
add(corner);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue