mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Prebuilt module for commit a5a0e90bee
This commit is contained in:
parent
63b1c89563
commit
64ea68043c
8 changed files with 229 additions and 63 deletions
40
dist/docs/assets/js/paper.js
vendored
40
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Thu Jul 21 20:57:39 2016 +0200
|
||||
* Date: Thu Jul 21 23:07:01 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -7677,6 +7677,34 @@ var PathItem = Item.extend({
|
|||
}
|
||||
},
|
||||
|
||||
compare: function(path) {
|
||||
var ok = false;
|
||||
if (path) {
|
||||
var paths1 = this._children || [this],
|
||||
paths2 = path._children.slice() || [path],
|
||||
length1 = paths1.length,
|
||||
length2 = paths2.length,
|
||||
matched = [],
|
||||
count;
|
||||
ok = true;
|
||||
for (var i1 = length1 - 1; i1 >= 0 && ok; i1--) {
|
||||
var path1 = paths1[i1];
|
||||
ok = false;
|
||||
for (var i2 = length2 - 1; i2 >= 0 && !ok; i2--) {
|
||||
if (Path.compare(path1, paths2[i2])) {
|
||||
if (!matched[i2]) {
|
||||
matched[i2] = true;
|
||||
count++;
|
||||
}
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
ok = ok && count === length2;
|
||||
}
|
||||
return ok;
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
var Path = PathItem.extend({
|
||||
|
@ -8426,7 +8454,9 @@ var Path = PathItem.extend({
|
|||
|
||||
toPath: '#clone',
|
||||
|
||||
compare: function(path) {
|
||||
compare: function compare(path) {
|
||||
if (!path || path instanceof CompoundPath)
|
||||
return compare.base.call(this, path);
|
||||
var curves1 = this.getCurves(),
|
||||
curves2 = path.getCurves(),
|
||||
length1 = curves1.length,
|
||||
|
@ -8438,12 +8468,12 @@ var Path = PathItem.extend({
|
|||
values2 = [],
|
||||
pos1 = 0, pos2,
|
||||
end1 = 0, end2;
|
||||
for (var i2 = 0; i2 < length2; i2++) {
|
||||
var v2 = curves2[i2].getValues();
|
||||
for (var i = 0; i < length2; i++) {
|
||||
var v2 = curves2[i].getValues();
|
||||
values2.push(v2);
|
||||
var overlaps = Curve.getOverlaps(v1, v2);
|
||||
if (overlaps) {
|
||||
pos2 = !i2 && overlaps[0][0] > 0 ? length2 - 1 : i2;
|
||||
pos2 = !i && overlaps[0][0] > 0 ? length2 - 1 : i;
|
||||
end2 = overlaps[0][1];
|
||||
break;
|
||||
}
|
||||
|
|
38
dist/docs/classes/CompoundPath.html
vendored
38
dist/docs/classes/CompoundPath.html
vendored
|
@ -7327,6 +7327,44 @@ function onMouseUp(event) {
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="compare-path" class="member">
|
||||
<div class="member-link">
|
||||
<a name="compare-path" href="#compare-path"><tt><b>compare</b>(path)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Compares the geometry of two paths to see if they describe the same shape, detecting cases where paths start in different segments or even use different amounts of curves to describe the same shape, as long as their orientation is the same, and their segments and handles really result in the same visual appearance of curves.</p>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>path:</tt>
|
||||
<a href="../classes/PathItem.html"><tt>PathItem</tt></a>
|
||||
— the path to compare this path’s geometry with
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><tt>Boolean</tt></tt> — <tt>true</tt> if two paths describe the shame shape, <tt>false</tt> otherwise
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
76
dist/docs/classes/Path.html
vendored
76
dist/docs/classes/Path.html
vendored
|
@ -2555,44 +2555,6 @@ path.selected = true;
|
|||
</div>
|
||||
|
||||
|
||||
<div id="compare-path" class="member">
|
||||
<div class="member-link">
|
||||
<a name="compare-path" href="#compare-path"><tt><b>compare</b>(path)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Compares the geometry of two paths to see if they describe the same shape, detecting cases where paths start in different segments or even use different amounts of curves to describe the same shape, as long as their orientation is the same, and their segments and handles really result in the same visual appearance of curves.</p>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>path:</tt>
|
||||
<a href="../classes/Path.html"><tt>Path</tt></a>
|
||||
— the path to compare this path’s geometry with
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><tt>Boolean</tt></tt> — <tt>true</tt> if two paths describe the shame shape, <tt>false</tt> otherwise
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<h3>Positions on Paths and Curves</h3>
|
||||
|
||||
<div id="getlocationof-point" class="member">
|
||||
|
@ -10060,6 +10022,44 @@ function onMouseUp(event) {
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="compare-path" class="member">
|
||||
<div class="member-link">
|
||||
<a name="compare-path" href="#compare-path"><tt><b>compare</b>(path)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Compares the geometry of two paths to see if they describe the same shape, detecting cases where paths start in different segments or even use different amounts of curves to describe the same shape, as long as their orientation is the same, and their segments and handles really result in the same visual appearance of curves.</p>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>path:</tt>
|
||||
<a href="../classes/PathItem.html"><tt>PathItem</tt></a>
|
||||
— the path to compare this path’s geometry with
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><tt>Boolean</tt></tt> — <tt>true</tt> if two paths describe the shame shape, <tt>false</tt> otherwise
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
38
dist/docs/classes/PathItem.html
vendored
38
dist/docs/classes/PathItem.html
vendored
|
@ -994,6 +994,44 @@ function onMouseUp(event) {
|
|||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="compare-path" class="member">
|
||||
<div class="member-link">
|
||||
<a name="compare-path" href="#compare-path"><tt><b>compare</b>(path)</tt></a>
|
||||
</div>
|
||||
<div class="member-description hidden">
|
||||
<div class="member-text">
|
||||
<p>Compares the geometry of two paths to see if they describe the same shape, detecting cases where paths start in different segments or even use different amounts of curves to describe the same shape, as long as their orientation is the same, and their segments and handles really result in the same visual appearance of curves.</p>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Parameters:</h4>
|
||||
|
||||
<li>
|
||||
<tt>path:</tt>
|
||||
<a href="../classes/PathItem.html"><tt>PathItem</tt></a>
|
||||
— the path to compare this path’s geometry with
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Returns:</h4>
|
||||
|
||||
<li>
|
||||
<tt><tt>Boolean</tt></tt> — <tt>true</tt> if two paths describe the shame shape, <tt>false</tt> otherwise
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
40
dist/paper-core.js
vendored
40
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Thu Jul 21 20:57:39 2016 +0200
|
||||
* Date: Thu Jul 21 23:07:01 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -7677,6 +7677,34 @@ var PathItem = Item.extend({
|
|||
}
|
||||
},
|
||||
|
||||
compare: function(path) {
|
||||
var ok = false;
|
||||
if (path) {
|
||||
var paths1 = this._children || [this],
|
||||
paths2 = path._children.slice() || [path],
|
||||
length1 = paths1.length,
|
||||
length2 = paths2.length,
|
||||
matched = [],
|
||||
count;
|
||||
ok = true;
|
||||
for (var i1 = length1 - 1; i1 >= 0 && ok; i1--) {
|
||||
var path1 = paths1[i1];
|
||||
ok = false;
|
||||
for (var i2 = length2 - 1; i2 >= 0 && !ok; i2--) {
|
||||
if (Path.compare(path1, paths2[i2])) {
|
||||
if (!matched[i2]) {
|
||||
matched[i2] = true;
|
||||
count++;
|
||||
}
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
ok = ok && count === length2;
|
||||
}
|
||||
return ok;
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
var Path = PathItem.extend({
|
||||
|
@ -8426,7 +8454,9 @@ var Path = PathItem.extend({
|
|||
|
||||
toPath: '#clone',
|
||||
|
||||
compare: function(path) {
|
||||
compare: function compare(path) {
|
||||
if (!path || path instanceof CompoundPath)
|
||||
return compare.base.call(this, path);
|
||||
var curves1 = this.getCurves(),
|
||||
curves2 = path.getCurves(),
|
||||
length1 = curves1.length,
|
||||
|
@ -8438,12 +8468,12 @@ var Path = PathItem.extend({
|
|||
values2 = [],
|
||||
pos1 = 0, pos2,
|
||||
end1 = 0, end2;
|
||||
for (var i2 = 0; i2 < length2; i2++) {
|
||||
var v2 = curves2[i2].getValues();
|
||||
for (var i = 0; i < length2; i++) {
|
||||
var v2 = curves2[i].getValues();
|
||||
values2.push(v2);
|
||||
var overlaps = Curve.getOverlaps(v1, v2);
|
||||
if (overlaps) {
|
||||
pos2 = !i2 && overlaps[0][0] > 0 ? length2 - 1 : i2;
|
||||
pos2 = !i && overlaps[0][0] > 0 ? length2 - 1 : i;
|
||||
end2 = overlaps[0][1];
|
||||
break;
|
||||
}
|
||||
|
|
10
dist/paper-core.min.js
vendored
10
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
40
dist/paper-full.js
vendored
40
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Thu Jul 21 20:57:39 2016 +0200
|
||||
* Date: Thu Jul 21 23:07:01 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -7677,6 +7677,34 @@ var PathItem = Item.extend({
|
|||
}
|
||||
},
|
||||
|
||||
compare: function(path) {
|
||||
var ok = false;
|
||||
if (path) {
|
||||
var paths1 = this._children || [this],
|
||||
paths2 = path._children.slice() || [path],
|
||||
length1 = paths1.length,
|
||||
length2 = paths2.length,
|
||||
matched = [],
|
||||
count;
|
||||
ok = true;
|
||||
for (var i1 = length1 - 1; i1 >= 0 && ok; i1--) {
|
||||
var path1 = paths1[i1];
|
||||
ok = false;
|
||||
for (var i2 = length2 - 1; i2 >= 0 && !ok; i2--) {
|
||||
if (Path.compare(path1, paths2[i2])) {
|
||||
if (!matched[i2]) {
|
||||
matched[i2] = true;
|
||||
count++;
|
||||
}
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
ok = ok && count === length2;
|
||||
}
|
||||
return ok;
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
var Path = PathItem.extend({
|
||||
|
@ -8426,7 +8454,9 @@ var Path = PathItem.extend({
|
|||
|
||||
toPath: '#clone',
|
||||
|
||||
compare: function(path) {
|
||||
compare: function compare(path) {
|
||||
if (!path || path instanceof CompoundPath)
|
||||
return compare.base.call(this, path);
|
||||
var curves1 = this.getCurves(),
|
||||
curves2 = path.getCurves(),
|
||||
length1 = curves1.length,
|
||||
|
@ -8438,12 +8468,12 @@ var Path = PathItem.extend({
|
|||
values2 = [],
|
||||
pos1 = 0, pos2,
|
||||
end1 = 0, end2;
|
||||
for (var i2 = 0; i2 < length2; i2++) {
|
||||
var v2 = curves2[i2].getValues();
|
||||
for (var i = 0; i < length2; i++) {
|
||||
var v2 = curves2[i].getValues();
|
||||
values2.push(v2);
|
||||
var overlaps = Curve.getOverlaps(v1, v2);
|
||||
if (overlaps) {
|
||||
pos2 = !i2 && overlaps[0][0] > 0 ? length2 - 1 : i2;
|
||||
pos2 = !i && overlaps[0][0] > 0 ? length2 - 1 : i;
|
||||
end2 = overlaps[0][1];
|
||||
break;
|
||||
}
|
||||
|
|
10
dist/paper-full.min.js
vendored
10
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue