mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 23:39:59 -05:00
More clean-ups.
This commit is contained in:
parent
79785afa2a
commit
f8367bb0dd
1 changed files with 5 additions and 10 deletions
|
@ -1646,8 +1646,7 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
tolerance = options.tolerance || 0,
|
tolerance = options.tolerance || 0,
|
||||||
radius = 0, join, cap, miterLimit,
|
radius = 0, join, cap, miterLimit,
|
||||||
that = this,
|
that = this,
|
||||||
loc,
|
area, loc, res;
|
||||||
res;
|
|
||||||
|
|
||||||
if (options.stroke && style.getStrokeColor()) {
|
if (options.stroke && style.getStrokeColor()) {
|
||||||
join = style.getStrokeJoin();
|
join = style.getStrokeJoin();
|
||||||
|
@ -1667,8 +1666,7 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
var pt = seg._point;
|
var pt = seg._point;
|
||||||
// Note, when checking for ends, we don't also check for handles,
|
// Note, when checking for ends, we don't also check for handles,
|
||||||
// since this will happen afterwards in a separate loop, see below.
|
// since this will happen afterwards in a separate loop, see below.
|
||||||
return (ends || options.segments)
|
return (ends || options.segments) && checkPoint(seg, pt, 'segment')
|
||||||
&& checkPoint(seg, pt, 'segment')
|
|
||||||
|| (!ends && options.handles) && (
|
|| (!ends && options.handles) && (
|
||||||
checkPoint(seg, pt.add(seg._handleIn), 'handle-in') ||
|
checkPoint(seg, pt.add(seg._handleIn), 'handle-in') ||
|
||||||
checkPoint(seg, pt.add(seg._handleOut), 'handle-out'));
|
checkPoint(seg, pt.add(seg._handleOut), 'handle-out'));
|
||||||
|
@ -1676,8 +1674,6 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
|
|
||||||
// Code to check stroke join / cap areas
|
// Code to check stroke join / cap areas
|
||||||
|
|
||||||
var area;
|
|
||||||
|
|
||||||
function addAreaPoint(point) {
|
function addAreaPoint(point) {
|
||||||
area.push(point);
|
area.push(point);
|
||||||
}
|
}
|
||||||
|
@ -1692,8 +1688,7 @@ var Path = PathItem.extend(/** @lends Path# */{
|
||||||
|
|
||||||
function isInArea(point) {
|
function isInArea(point) {
|
||||||
var length = area.length,
|
var length = area.length,
|
||||||
last = getAreaCurve(length - 1),
|
previous = getAreaCurve(length - 1),
|
||||||
previous = last,
|
|
||||||
roots = new Array(3),
|
roots = new Array(3),
|
||||||
crossings = 0;
|
crossings = 0;
|
||||||
for (var i = 0; i < length; i++) {
|
for (var i = 0; i < length; i++) {
|
||||||
|
@ -1716,8 +1711,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,
|
Path._addSquareJoin(segment, join, radius, miterLimit,
|
||||||
miterLimit, addAreaPoint, true);
|
addAreaPoint, true);
|
||||||
} else if (cap !== 'round') {
|
} else if (cap !== 'round') {
|
||||||
// It's a cap
|
// It's a cap
|
||||||
Path._addSquareCap(segment, cap, radius, addAreaPoint, true);
|
Path._addSquareCap(segment, cap, radius, addAreaPoint, true);
|
||||||
|
|
Loading…
Reference in a new issue