I don't see much usage of this in dynapi3 except in these methods, and even there I don't think it's usefull.
What's the point of having a isChild when you have a parent property ?
No dynlayer is supposed to be parent less, right ? They're either child of the dyndocument or child of another dynlayer.
So unless I miss something, which I might ! We could get rid of it !
Plus in the following functions, event when the parent is the document, getPageX() and getPageY() will return 0 and you would end up with the same result, right ?
The question is, does dynapi3 is meant to support layers that don't have a parent property, because that's required if you remove the isChild test in these 2 methods.
p.setPageLocation = function(x,y) {
if (this.isChild) {
if (x!=null) x = x - this.parent.getPageX();
if (y!=null) y = y - this.parent.getPageY();
}
return this.setLocation(x,y);
};
p.getPageX=function() {return (this.isChild)? this.parent.getPageX()+(this.x||0) : this.x||0};
p.getPageY=function() {return (this.isChild)? this.parent.getPageY()+(this.y||0) : this.y||0};
Benoit
- Re: [Dynapi-Dev] isChild utility ? Benoit Marchant
- Re: [Dynapi-Dev] isChild utility ? Doug Melvin