André is the expert on these text calculations.  His input would be invaluable.

On 2011-07-18, at 16:49, [email protected] wrote:

> Author: dda
> Date: 2011-07-18 13:49:40 -0700 (Mon, 18 Jul 2011)
> New Revision: 19277
> 
> Modified:
>   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
> Log:
> Change dda-20110718-nJa by [email protected] on 2011-07-18 15:55:45 EDT
>    in /Users/dda/laszlo/src/svn/openlaszlo/trunk-d
>    for http://svn.openlaszlo.org/openlaszlo/trunk
> 
> Summary: Fix to set the text height correctly when it is implicitly set
> 
> New Features:
> 
> Bugs Fixed: LPP-10001 (OL 5.0.x - When <text> height is not explicitly set, 
> but its text is, the height is not set correctly)
> 
> Technical Reviewer: hminsky (pending)
> QA Reviewer: (pending)
> Doc Reviewer: (pending)
> 
> Documentation:
> 
> Release Notes:
> 
> Overview:
>    This is Henry's fix, I'm actually the reviewer (-dda).
>    The change includes adding a padding.
> 
> Details:
>    Although the change passes the test cases there are some things
>    I don't understand about it: 1) the 'if' check following
>    the changed line will now always evaluate false, so really should
>    be removed.  Is there something that the if statement did or
>    intended to do that is now being missed?
>    2) Every other use of PAD_TEXTHEIGHT is conditional on whether
>    the textfield is multiline, but not this one.  And the test case
>    is with a multiline text.  Yeah, I see PAD_MULTI_TEXTHEIGHT is 0,
>    so coding it like the others would not fix anything, but clearly
>    something is amiss (or at least convoluted) in the use of these
>    two padding constants.
> 
>    I cannot argue with the fact that the change works, and is
>    an improvement (or at least the same) for all tests I have tried.
>    BTW, it does not have an effect on LPP-10003.
> 
> Tests:
>    test case in LPP-10001
>    test/lfc/maxscroll.lzx
>    smokecheck (SWF10)
> 
> 
> 
> Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
> ===================================================================
> --- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as      
> 2011-07-14 00:51:17 UTC (rev 19276)
> +++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as      
> 2011-07-18 20:49:40 UTC (rev 19277)
> @@ -626,7 +626,7 @@
> 
>             // resizable fields adjust their height
>             if (! owner.hassetheight) {
> -                var theight:Number = textfield.textHeight;
> +                var theight:Number = textfield.textHeight + PAD_TEXTHEIGHT;
>                 if (theight == 0) theight = this.lineheight;
>                 this.setHeight(theight + (textfield.multiline ? 
> LzTextSprite.PAD_MULTI_TEXTHEIGHT : LzTextSprite.PAD_TEXTHEIGHT));
>             }
> 
> 
> _______________________________________________
> Laszlo-checkins mailing list
> [email protected]
> http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins


Reply via email to