mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Prebuilt module for commit acfe6cddeb
This commit is contained in:
parent
1765a19e67
commit
9d6637ed41
6 changed files with 126 additions and 36 deletions
35
dist/docs/assets/js/paper.js
vendored
35
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Thu Jul 14 09:32:29 2016 +0200
|
||||
* Date: Thu Jul 14 10:49:12 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -9346,6 +9346,22 @@ var CompoundPath = PathItem.extend({
|
|||
this.reverse();
|
||||
},
|
||||
|
||||
isClosed: function() {
|
||||
var children = this._children;
|
||||
for (var i = 0, l = children.length; i < l; i++) {
|
||||
if (!children[i]._closed)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
setClosed: function(closed) {
|
||||
var children = this._children;
|
||||
for (var i = 0, l = children.length; i < l; i++) {
|
||||
children[i].setClosed(closed);
|
||||
}
|
||||
},
|
||||
|
||||
getFirstSegment: function() {
|
||||
var first = this.getFirstChild();
|
||||
return first && first.getFirstSegment();
|
||||
|
@ -9371,7 +9387,7 @@ var CompoundPath = PathItem.extend({
|
|||
|
||||
getLastCurve: function() {
|
||||
var last = this.getLastChild();
|
||||
return last && last.getFirstCurve();
|
||||
return last && last.getLastCurve();
|
||||
},
|
||||
|
||||
getArea: function() {
|
||||
|
@ -9494,10 +9510,12 @@ PathItem.inject(new function() {
|
|||
exclude: { 1: true }
|
||||
};
|
||||
|
||||
function preparePath(path, resolve) {
|
||||
function preparePath(path, closed) {
|
||||
var res = path.clone(false).reduce({ simplify: true })
|
||||
.transform(null, true, true);
|
||||
return resolve ? res.resolveCrossings() : res;
|
||||
if (closed)
|
||||
res.setClosed(true);
|
||||
return closed ? res.resolveCrossings() : res;
|
||||
}
|
||||
|
||||
function createResult(ctor, paths, reduce, path1, path2) {
|
||||
|
@ -9514,7 +9532,7 @@ PathItem.inject(new function() {
|
|||
function computeBoolean(path1, path2, operation) {
|
||||
var operator = operators[operation];
|
||||
operator[operation] = true;
|
||||
if (!path1._children && !path1._closed)
|
||||
if (!path1.isClosed())
|
||||
return computeOpenBoolean(path1, path2, operator);
|
||||
var _path1 = preparePath(path1, true),
|
||||
_path2 = path2 && path1 !== path2 && preparePath(path2, true);
|
||||
|
@ -9560,9 +9578,10 @@ PathItem.inject(new function() {
|
|||
}
|
||||
|
||||
function computeOpenBoolean(path1, path2, operator) {
|
||||
if (!path2 || !path2._children && !path2._closed
|
||||
|| !operator.subtract && !operator.intersect)
|
||||
return null;
|
||||
if (!path2 || !operator.subtract && !operator.intersect) {
|
||||
throw new Error('Boolean operations on open paths only support ' +
|
||||
'subtraction and intersection with another path.');
|
||||
}
|
||||
var _path1 = preparePath(path1, false),
|
||||
_path2 = preparePath(path2, false),
|
||||
crossings = _path1.getCrossings(_path2),
|
||||
|
|
41
dist/docs/classes/CompoundPath.html
vendored
41
dist/docs/classes/CompoundPath.html
vendored
|
@ -182,6 +182,39 @@ path.fillColor = 'black';
|
|||
</div>
|
||||
|
||||
|
||||
<div id="closed" class="member">
|
||||
<div class="member-link">
|
||||
<a name="closed" href="#closed"><tt><b>closed</b></tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
|
||||
<div class="member-text">
|
||||
<p>Specifies whether the compound-path is fully closed, meaning all its contained sub-paths are closed path.</p>
|
||||
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Type:</h4>
|
||||
<li>
|
||||
<tt>Boolean</tt>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>See also:</h4>
|
||||
|
||||
<li><tt><tt>Path#isClosed</tt>()</tt></li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="firstsegment" class="member">
|
||||
<div class="member-link">
|
||||
<a name="firstsegment" href="#firstsegment"><tt><b>firstSegment</b></tt></a>
|
||||
|
@ -189,7 +222,7 @@ path.fillColor = 'black';
|
|||
<div class="member-description hidden">
|
||||
|
||||
<div class="member-text">
|
||||
<p>The first Segment contained within the path.</p>
|
||||
<p>The first Segment contained within the compound-path, a short-cut to calling <tt>Path#getFirstSegment</tt>() on <tt>Item#getFirstChild</tt>().</p>
|
||||
|
||||
<p>Read only.</p>
|
||||
|
||||
|
@ -217,7 +250,7 @@ path.fillColor = 'black';
|
|||
<div class="member-description hidden">
|
||||
|
||||
<div class="member-text">
|
||||
<p>The last Segment contained within the path.</p>
|
||||
<p>The last Segment contained within the compound-path, a short-cut to calling <tt>Path#getLastSegment</tt>() on <tt>Item#getLastChild</tt>().</p>
|
||||
|
||||
<p>Read only.</p>
|
||||
|
||||
|
@ -273,7 +306,7 @@ path.fillColor = 'black';
|
|||
<div class="member-description hidden">
|
||||
|
||||
<div class="member-text">
|
||||
<p>The first Curve contained within the path.</p>
|
||||
<p>The first Curve contained within the compound-path, a short-cut to calling <tt>Path#getFirstCurve</tt>() on <tt>Item#getFirstChild</tt>().</p>
|
||||
|
||||
<p>Read only.</p>
|
||||
|
||||
|
@ -301,7 +334,7 @@ path.fillColor = 'black';
|
|||
<div class="member-description hidden">
|
||||
|
||||
<div class="member-text">
|
||||
<p>The last Curve contained within the path.</p>
|
||||
<p>The last Curve contained within the compound-path, a short-cut to calling <tt>Path#getLastCurve</tt>() on <tt>Item#getLastChild</tt>().</p>
|
||||
|
||||
<p>Read only.</p>
|
||||
|
||||
|
|
35
dist/paper-core.js
vendored
35
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Thu Jul 14 09:32:29 2016 +0200
|
||||
* Date: Thu Jul 14 10:49:12 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -9346,6 +9346,22 @@ var CompoundPath = PathItem.extend({
|
|||
this.reverse();
|
||||
},
|
||||
|
||||
isClosed: function() {
|
||||
var children = this._children;
|
||||
for (var i = 0, l = children.length; i < l; i++) {
|
||||
if (!children[i]._closed)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
setClosed: function(closed) {
|
||||
var children = this._children;
|
||||
for (var i = 0, l = children.length; i < l; i++) {
|
||||
children[i].setClosed(closed);
|
||||
}
|
||||
},
|
||||
|
||||
getFirstSegment: function() {
|
||||
var first = this.getFirstChild();
|
||||
return first && first.getFirstSegment();
|
||||
|
@ -9371,7 +9387,7 @@ var CompoundPath = PathItem.extend({
|
|||
|
||||
getLastCurve: function() {
|
||||
var last = this.getLastChild();
|
||||
return last && last.getFirstCurve();
|
||||
return last && last.getLastCurve();
|
||||
},
|
||||
|
||||
getArea: function() {
|
||||
|
@ -9494,10 +9510,12 @@ PathItem.inject(new function() {
|
|||
exclude: { 1: true }
|
||||
};
|
||||
|
||||
function preparePath(path, resolve) {
|
||||
function preparePath(path, closed) {
|
||||
var res = path.clone(false).reduce({ simplify: true })
|
||||
.transform(null, true, true);
|
||||
return resolve ? res.resolveCrossings() : res;
|
||||
if (closed)
|
||||
res.setClosed(true);
|
||||
return closed ? res.resolveCrossings() : res;
|
||||
}
|
||||
|
||||
function createResult(ctor, paths, reduce, path1, path2) {
|
||||
|
@ -9514,7 +9532,7 @@ PathItem.inject(new function() {
|
|||
function computeBoolean(path1, path2, operation) {
|
||||
var operator = operators[operation];
|
||||
operator[operation] = true;
|
||||
if (!path1._children && !path1._closed)
|
||||
if (!path1.isClosed())
|
||||
return computeOpenBoolean(path1, path2, operator);
|
||||
var _path1 = preparePath(path1, true),
|
||||
_path2 = path2 && path1 !== path2 && preparePath(path2, true);
|
||||
|
@ -9560,9 +9578,10 @@ PathItem.inject(new function() {
|
|||
}
|
||||
|
||||
function computeOpenBoolean(path1, path2, operator) {
|
||||
if (!path2 || !path2._children && !path2._closed
|
||||
|| !operator.subtract && !operator.intersect)
|
||||
return null;
|
||||
if (!path2 || !operator.subtract && !operator.intersect) {
|
||||
throw new Error('Boolean operations on open paths only support ' +
|
||||
'subtraction and intersection with another path.');
|
||||
}
|
||||
var _path1 = preparePath(path1, false),
|
||||
_path2 = preparePath(path2, false),
|
||||
crossings = _path1.getCrossings(_path2),
|
||||
|
|
8
dist/paper-core.min.js
vendored
8
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
35
dist/paper-full.js
vendored
35
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Thu Jul 14 09:32:29 2016 +0200
|
||||
* Date: Thu Jul 14 10:49:12 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -9346,6 +9346,22 @@ var CompoundPath = PathItem.extend({
|
|||
this.reverse();
|
||||
},
|
||||
|
||||
isClosed: function() {
|
||||
var children = this._children;
|
||||
for (var i = 0, l = children.length; i < l; i++) {
|
||||
if (!children[i]._closed)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
setClosed: function(closed) {
|
||||
var children = this._children;
|
||||
for (var i = 0, l = children.length; i < l; i++) {
|
||||
children[i].setClosed(closed);
|
||||
}
|
||||
},
|
||||
|
||||
getFirstSegment: function() {
|
||||
var first = this.getFirstChild();
|
||||
return first && first.getFirstSegment();
|
||||
|
@ -9371,7 +9387,7 @@ var CompoundPath = PathItem.extend({
|
|||
|
||||
getLastCurve: function() {
|
||||
var last = this.getLastChild();
|
||||
return last && last.getFirstCurve();
|
||||
return last && last.getLastCurve();
|
||||
},
|
||||
|
||||
getArea: function() {
|
||||
|
@ -9494,10 +9510,12 @@ PathItem.inject(new function() {
|
|||
exclude: { 1: true }
|
||||
};
|
||||
|
||||
function preparePath(path, resolve) {
|
||||
function preparePath(path, closed) {
|
||||
var res = path.clone(false).reduce({ simplify: true })
|
||||
.transform(null, true, true);
|
||||
return resolve ? res.resolveCrossings() : res;
|
||||
if (closed)
|
||||
res.setClosed(true);
|
||||
return closed ? res.resolveCrossings() : res;
|
||||
}
|
||||
|
||||
function createResult(ctor, paths, reduce, path1, path2) {
|
||||
|
@ -9514,7 +9532,7 @@ PathItem.inject(new function() {
|
|||
function computeBoolean(path1, path2, operation) {
|
||||
var operator = operators[operation];
|
||||
operator[operation] = true;
|
||||
if (!path1._children && !path1._closed)
|
||||
if (!path1.isClosed())
|
||||
return computeOpenBoolean(path1, path2, operator);
|
||||
var _path1 = preparePath(path1, true),
|
||||
_path2 = path2 && path1 !== path2 && preparePath(path2, true);
|
||||
|
@ -9560,9 +9578,10 @@ PathItem.inject(new function() {
|
|||
}
|
||||
|
||||
function computeOpenBoolean(path1, path2, operator) {
|
||||
if (!path2 || !path2._children && !path2._closed
|
||||
|| !operator.subtract && !operator.intersect)
|
||||
return null;
|
||||
if (!path2 || !operator.subtract && !operator.intersect) {
|
||||
throw new Error('Boolean operations on open paths only support ' +
|
||||
'subtraction and intersection with another path.');
|
||||
}
|
||||
var _path1 = preparePath(path1, false),
|
||||
_path2 = preparePath(path2, false),
|
||||
crossings = _path1.getCrossings(_path2),
|
||||
|
|
8
dist/paper-full.min.js
vendored
8
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue