mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Reactivate commented out code in addBevelJoin(), since it is required in some situations.
This commit is contained in:
parent
78c7f645ab
commit
8b32aa9f09
1 changed files with 4 additions and 6 deletions
|
@ -552,9 +552,8 @@ var Path = this.Path = PathItem.extend({
|
|||
function addBevelJoin(curve, t) {
|
||||
var point = curve.getPoint(t),
|
||||
normal = curve.getNormal(t).normalize(radius);
|
||||
// TODO: Both required? Check other directions
|
||||
bounds = bounds.include(point.add(normal));
|
||||
// bounds = bounds.include(point.subtract(normal));
|
||||
bounds = bounds.include(point.subtract(normal));
|
||||
}
|
||||
|
||||
function addJoin(segment, join) {
|
||||
|
@ -601,14 +600,13 @@ var Path = this.Path = PathItem.extend({
|
|||
case 'butt':
|
||||
case 'square':
|
||||
// Calculate the corner points of butt and square caps
|
||||
var point = segment._point,
|
||||
curve = segment.getCurve(),
|
||||
var curve = segment.getCurve(),
|
||||
point = curve.getPoint(t),
|
||||
normal = curve.getNormal(t).normalize(radius);
|
||||
// For square caps, we need to step away from point in the
|
||||
// direction of the tangent, which is the rotated normal
|
||||
if (cap == 'square') {
|
||||
if (cap == 'square')
|
||||
point = point.add(normal.y, -normal.x);
|
||||
}
|
||||
bounds = bounds.include(point.add(normal));
|
||||
bounds = bounds.include(point.subtract(normal));
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue