Prebuilt module for commit a5a0e90bee

This commit is contained in:
Paper.js Bot 2016-07-21 21:10:47 +00:00
parent 63b1c89563
commit 64ea68043c
8 changed files with 229 additions and 63 deletions

View file

@ -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;
}

View file

@ -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>
&mdash;&nbsp;the path to compare this path&rsquo;s geometry with
</li>
</ul>
<ul class="member-list">
<h4>Returns:</h4>
<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if two paths describe the shame shape, <tt>false</tt> otherwise
</li>
</ul>
</div>
</div>
</div>

View file

@ -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>
&mdash;&nbsp;the path to compare this path&rsquo;s geometry with
</li>
</ul>
<ul class="member-list">
<h4>Returns:</h4>
<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<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>
&mdash;&nbsp;the path to compare this path&rsquo;s geometry with
</li>
</ul>
<ul class="member-list">
<h4>Returns:</h4>
<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<tt>true</tt> if two paths describe the shame shape, <tt>false</tt> otherwise
</li>
</ul>
</div>
</div>
</div>

View file

@ -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>
&mdash;&nbsp;the path to compare this path&rsquo;s geometry with
</li>
</ul>
<ul class="member-list">
<h4>Returns:</h4>
<li>
<tt><tt>Boolean</tt></tt>&nbsp;&mdash;&nbsp;<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
View file

@ -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;
}

File diff suppressed because one or more lines are too long

40
dist/paper-full.js vendored
View file

@ -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;
}

File diff suppressed because one or more lines are too long