The text class calls

        this.fontname = this.searchParents( "fontname" ).fontname;

for font name/size/style properties

searchParents is implemented as

LzView.prototype.searchParents = function ( prop ){
    var sview = this;
    do{
        sview = sview.immediateparent;
        if (sview[ prop ] != null ){
            return sview;
        }
    }while ( sview != canvas );
}

Would it be more efficient if the searchParents function set the properties all the way back down the parent
chain when it found one, so that other calls wouldn't have to search up past their first parent? It seems like with the
way the value is filled in now, that wouldn't change the behavior because in the current code the font style attributes which are null at runtime are found and cached on a text element, and then modifying the parent has no subsequent effect on the text font style. So caching the parent values as well wouldn't change things anyway.


--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to