History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-2958
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: P1 P1
Assignee: Henry Minsky
Reporter: Henry Minsky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

lztest-textstyle.lzx fails in legals

Created: 20/Oct/06 04:18 PM   Updated: 24/Jul/07 09:56 AM
Component/s: LFC - Text
Affects Version/s: OL4B1
Fix Version/s: Legals

Time Tracking:
Not Specified

Severity: Minor
Fixed in Change#: 5,504
Runtime: N/A
Release Note Text: There are minor display differences between SWF and DHTML, because SWF uses a separate background movieclip, whereas DHTML just uses bgcolor attribute of text. Workaround (except Safari) is to put an extra view in behind the text view.
Fix in hand: False


 Description  « Hide
The test in test/lztest/lztest-textstyle.lzx fails in legals

It is trying to query the fgcolor and bgcolor attributes of a LzText object, and they come back undefined.
These ought to be defined.


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
P T Withington - 08/Dec/06 11:04 AM
This says it passes, although the appearance of the output is different. There is a blue bar under the text in SWF and not in DHTML.

Henry Minsky - 16/Jan/07 08:28 PM
The issue with the blue bar seems to be that a text view with a colored background and an empty string value gets
a few pixels of padding or something in the SWF case, which show up in the bgcolor, but that does not happen in DHTML. If the text is not blank, then it looks
the same in SWF and DHTML.


Henry Minsky - 25/May/07 10:56 AM
I have a proposal to not size text fields to 100 by default, which would fix this

$ svn diff WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
Index: WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
===================================================================
--- WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as (revision 5184)
+++ WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as (working copy)
@@ -159,8 +159,6 @@
 LzTextSprite.prototype.maxhscroll = 0;


-//DEFAULT_WIDTH: Width to use for text field if none is specified
-LzTextSprite.prototype.DEFAULT_WIDTH = 100;
 // [todo: 2004-3-29 hqm] lines seem to get the ends clipped off if you use the TextField.textWidth
 // from Flash, so I am adding a constant. Am I missing something here?
 LzTextSprite.prototype.PAD_TEXTWIDTH = 4;
@@ -253,7 +251,7 @@
     var mw = mc.wordWrap;
     mc.multiline = false;
     mc.wordWrap = false;
- var twidth = mc.textWidth + this.PAD_TEXTWIDTH;
+ var twidth = mc.textWidth == 0 ? 0 : mc.textWidth + this.PAD_TEXTWIDTH;
     mc.multiline = ml;
     mc.wordWrap = mw;
     return twidth;

hqm@IBM-2E06404CB67 /cygdrive/c/users/hqm/openlaszlo/legals3
$ svn diff WEB-INF/lps/lfc/views/LzText.lzs
Index: WEB-INF/lps/lfc/views/LzText.lzs
===================================================================
--- WEB-INF/lps/lfc/views/LzText.lzs (revision 5184)
+++ WEB-INF/lps/lfc/views/LzText.lzs (working copy)
@@ -106,16 +106,6 @@
   */
 static var DEFAULT_WIDTH = 100;

-/**
- * @access private
- * @keywords final
- * @todo 2004-3-29 hqm lines seem to get the ends clipped off if you use the TextField.textWidth
- * from Flash, so I am adding a constant. Am I missing something here?
- */
-static var PAD_TEXTWIDTH = 4;
-
-static var DEFAULT_SIZE = 8;
-
 defaultattrs.pixellock = true;

 /**
@@ -221,12 +211,9 @@
         if (this.text != null && this.text != '' && this.text.length > 0) {
             args.width = this.getTextWidth();
         } else {
- // Empty string would result in a zero width view, which confuses
- // developers, so use something reasonable instead.
- args.width = this.DEFAULT_WIDTH;
+ args.width = 0;
         }
     }
- if (args.width == null) args.width = 100;

     // To compute our height:
     // + If height is supplied, use it.


But we still need a default size for InputText to keep it from not appearing at all in the default use case.

Henry Minsky - 30/May/07 11:29 AM
out to max for review

Henry Minsky - 22/Jun/07 01:01 PM
updated the lztest-textheight.lzx, there are still two failures but those occurred prior to this change.


Mamye Kratt - 03/Jul/07 02:51 PM
(4.0 branch (4.0.3) build r5544)
Testfile fails:
test/lztest/lztest-textstyle.lzx

Henry Minsky - 24/Jul/07 09:56 AM
lztest-textstyle passes for me in swf8 and DHTML, in FF, and IE7 (windows XP)

I am closing this bug, but a new bug needs to be filed because an associated test lztest-textheight.lzx is failing still.