mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Fix two issues in compare()
Variable `count` was never initialized, so incrementing resulted in a NaN. Creating `paths2` failed if `path._children` was `undefined`.
This commit is contained in:
parent
6dd7cc5b6a
commit
eef2297935
1 changed files with 2 additions and 2 deletions
|
@ -776,11 +776,11 @@ var PathItem = Item.extend(/** @lends PathItem# */{
|
||||||
var ok = false;
|
var ok = false;
|
||||||
if (path) {
|
if (path) {
|
||||||
var paths1 = this._children || [this],
|
var paths1 = this._children || [this],
|
||||||
paths2 = path._children.slice() || [path],
|
paths2 = path._children ? path._children.slice() : [path],
|
||||||
length1 = paths1.length,
|
length1 = paths1.length,
|
||||||
length2 = paths2.length,
|
length2 = paths2.length,
|
||||||
matched = [],
|
matched = [],
|
||||||
count;
|
count = 0;
|
||||||
ok = true;
|
ok = true;
|
||||||
for (var i1 = length1 - 1; i1 >= 0 && ok; i1--) {
|
for (var i1 = length1 - 1; i1 >= 0 && ok; i1--) {
|
||||||
var path1 = paths1[i1];
|
var path1 = paths1[i1];
|
||||||
|
|
Loading…
Reference in a new issue