That's a bit clearer.

I wonder if we really should be examining the contract of __initTextProperties; should it really be getting the whole args list, or just a subset? Then you wouldn't have to smash args back and forth. And... I see that __initTextProperties seems to already look for LzInitExpr for some of its args. It seems we ought to be doing this in one place or the other not some in each.

Would it be simpler if at the LzText level we just look for the font properties not being defined and default them to parent value, and then worry about the LzInitExpr in __initTextProperties?

On 2008-05-28, at 12:27 EDT, André Bargull wrote:

Less voodoo in the LFC?  :-)
(To be honest, I wasn't really convinced by my work, too. But on the other hand, I didn't want to blow up the code resp. slow it down too much: e.g. by having two booleans variables per argument, which would have been a waste as I don't want to save 2^2 states,
or by creating a copy of the args-object through LzInheritedHash.)

So, next try. Maybe that's easier to follow:
var argsMap:Object = {font:fontname, fontsize:fontsize, fontstyle:fontstyle};
   var argsCpy:Object = {};
   for (var key:String in argsMap) {
       var val:String = argsMap[key];
var hasArg:Boolean = (key in args) ? true : false;// swf9 forces me to do this...
       var initExpr:Boolean = hasArg && args[key] is LzInitExpr;
       argsCpy[key] = initExpr ? args[key] : LzNode._ignoreAttribute;
       if (hasArg && !initExpr) {
           this[val] = args[key];
       } else {
           this[val] = args[key] = this.searchParents( val )[ val ];
       }
   }
var tsprite:LzTextSprite = (this.sprite cast LzTextSprite); tsprite.__initTextProperties(args);
       for (var key:String in argsCpy) {
       args[key] = argsCpy[key];
   }


On 5/28/2008 5:18 PM, P T Withington wrote:
Is there any way we could straighten out the logic so it is easier to understand? I'm having a hard time figuring out what's going on here. Since you set and read the tri-state flags within a few lines of each other, it seems there ought to be an easier way to do this.

On 2008-05-24, at 19:18 EDT, André Bargull wrote:

Update: last change contained a braino, which is now fixed.

Change 20080524-bargull-KxK by [EMAIL PROTECTED] on 2008-05-24 23:55:34
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: make font-attributes constrainable again

New Features:

Bugs Fixed: LPP-6038

Technical Reviewer: ptw
QA Reviewer: promanik
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
Font attribute (fontname, fontsize, fontstyle) are special cased in "LzText#construct(..)". And since constraints are no longer held in the
$refs object, the special casing need to be adjusted.


Tests:

Files:
M WEB-INF/lps/lfc/views/LzText.lzs

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080524-bargull-KxK.tar







Reply via email to