mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Fix Item#isDescendant(item).
This commit is contained in:
parent
d7fc9cf481
commit
e9e987f304
1 changed files with 3 additions and 2 deletions
|
@ -291,11 +291,12 @@ Item = Base.extend({
|
||||||
*/
|
*/
|
||||||
isDescendant: function(item) {
|
isDescendant: function(item) {
|
||||||
var parent = this, isDescendant = false;
|
var parent = this, isDescendant = false;
|
||||||
while(parent = parent.parent) {
|
while(parent) {
|
||||||
if(parent.children.indexOf(item) != -1) {
|
if(parent == item) {
|
||||||
isDescendant = true;
|
isDescendant = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
parent = parent.parent;
|
||||||
}
|
}
|
||||||
return isDescendant;
|
return isDescendant;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue