[Laszlo-checkins] r12360 - in openlaszlo/trunk: WEB-INF/lps/lfc/kernel/swf test/lztest
bargull@openlaszlo.org
bargull at openlaszlo.org
Thu Jan 8 05:18:41 PST 2009
Author: bargull
Date: 2009-01-08 05:18:35 -0800 (Thu, 08 Jan 2009)
New Revision: 12360
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
openlaszlo/trunk/test/lztest/lztest-textheight.lzx
Log:
Change 20090108-bargull-ggO by bargull at dell--p4--2-53 on 2009-01-08 12:29:40
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: fix for small multiline texts
New Features:
Bugs Fixed: LPP-7586
Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
set "wordWrap" to false when you measure the height of an empty textfield.
Tests:
testcase from bugreport
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as 2009-01-08 13:02:55 UTC (rev 12359)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as 2009-01-08 13:18:35 UTC (rev 12360)
@@ -291,8 +291,12 @@
// Measure test string if the field is empty
if (h == 4) {
var tct = textclip.htmlText;
+ var tcp = textclip.wordWrap;
+ // Make sure the test text does not wrap!
+ textclip.wordWrap = false;
textclip.htmlText = "__ypgSAMPLE__";
var h = textclip._height;
+ textclip.wordWrap = tcp;
textclip.htmlText = tct;
}
Modified: openlaszlo/trunk/test/lztest/lztest-textheight.lzx
===================================================================
--- openlaszlo/trunk/test/lztest/lztest-textheight.lzx 2009-01-08 13:02:55 UTC (rev 12359)
+++ openlaszlo/trunk/test/lztest/lztest-textheight.lzx 2009-01-08 13:18:35 UTC (rev 12360)
@@ -72,6 +72,10 @@
<text fontsize="20" text="Click Me 2" id="t14"/>
<text fontsize="${canvas.gfontSize}" id="t15" text="Click Me 1" resize="true"/>
<text fontsize="20" resize="true" id="t16" text="Click Me 2"/>
+
+ <!-- from LPP-7586 -->
+ <text id="t17" multiline="false" width="50" bgcolor="#aeaeae" />
+ <text id="t18" multiline="true" width="50" bgcolor="#aeaeae" />
</view>
<view name="inputtexts">
@@ -148,6 +152,8 @@
LzTestManager.assertEquals(28, t16.height, "text16 height");
t16.setAttribute('fontsize',50);
LzTestManager.assertEquals(64, t16.height, "text16 height");
+
+ LzTestManager.assertEquals(t17.height, t18.height, "text18 height");
}
textSizeSuite.testInputtextHeight = function () {
@@ -216,7 +222,7 @@
</canvas>
<!--
/* X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2007-2008 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2007-2009 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ******************************************************/
-->
More information about the Laszlo-checkins
mailing list