mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Rename Path. _addSquareJoin() to more suitable _addBevelJoin()
This commit is contained in:
parent
bd59be8629
commit
4129231504
1 changed files with 6 additions and 4 deletions
|
@ -1808,7 +1808,8 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
// the handles has to be zero too for this!)
|
// the handles has to be zero too for this!)
|
||||||
if (join !== 'round' && (segment._handleIn.isZero()
|
if (join !== 'round' && (segment._handleIn.isZero()
|
||||||
|| segment._handleOut.isZero()))
|
|| segment._handleOut.isZero()))
|
||||||
Path._addSquareJoin(segment, join, radius, miterLimit,
|
// _addBevelJoin() handles both 'bevel' and 'miter'!
|
||||||
|
Path._addBevelJoin(segment, join, radius, miterLimit,
|
||||||
addToArea, true);
|
addToArea, true);
|
||||||
} else if (cap !== 'round') {
|
} else if (cap !== 'round') {
|
||||||
// It's a cap
|
// It's a cap
|
||||||
|
@ -2550,7 +2551,7 @@ statics: {
|
||||||
&& handleIn.isColinear(handleOut)) {
|
&& handleIn.isColinear(handleOut)) {
|
||||||
addRound(segment);
|
addRound(segment);
|
||||||
} else {
|
} else {
|
||||||
Path._addSquareJoin(segment, join, radius, miterLimit, add);
|
Path._addBevelJoin(segment, join, radius, miterLimit, add);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2616,8 +2617,8 @@ statics: {
|
||||||
Math.abs(b * Math.sin(ty) * cos + a * Math.cos(ty) * sin)];
|
Math.abs(b * Math.sin(ty) * cos + a * Math.cos(ty) * sin)];
|
||||||
},
|
},
|
||||||
|
|
||||||
_addSquareJoin: function(segment, join, radius, miterLimit, addPoint, area) {
|
_addBevelJoin: function(segment, join, radius, miterLimit, addPoint, area) {
|
||||||
// Treat bevel and miter in one go, since they share a lot of code.
|
// Handles both 'bevel' and 'miter' joins, as they share a lot of code.
|
||||||
var curve2 = segment.getCurve(),
|
var curve2 = segment.getCurve(),
|
||||||
curve1 = curve2.getPrevious(),
|
curve1 = curve2.getPrevious(),
|
||||||
point = curve2.getPointAt(0, true),
|
point = curve2.getPointAt(0, true),
|
||||||
|
@ -2654,6 +2655,7 @@ statics: {
|
||||||
},
|
},
|
||||||
|
|
||||||
_addSquareCap: function(segment, cap, radius, addPoint, area) {
|
_addSquareCap: function(segment, cap, radius, addPoint, area) {
|
||||||
|
// Handles both 'square' and 'butt' caps, as they share a lot of code.
|
||||||
// Calculate the corner points of butt and square caps
|
// Calculate the corner points of butt and square caps
|
||||||
var point = segment._point,
|
var point = segment._point,
|
||||||
loc = segment.getLocation(),
|
loc = segment.getLocation(),
|
||||||
|
|
Loading…
Reference in a new issue