mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -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) {
|
||||
var parent = this, isDescendant = false;
|
||||
while(parent = parent.parent) {
|
||||
if(parent.children.indexOf(item) != -1) {
|
||||
while(parent) {
|
||||
if(parent == item) {
|
||||
isDescendant = true;
|
||||
break;
|
||||
}
|
||||
parent = parent.parent;
|
||||
}
|
||||
return isDescendant;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue