[Laszlo-checkins] r10239 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf
max@openlaszlo.org
max at openlaszlo.org
Mon Jul 7 16:36:42 PDT 2008
Author: max
Date: 2008-07-07 16:36:35 -0700 (Mon, 07 Jul 2008)
New Revision: 10239
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
Log:
Change 20080707-maxcarlson-t by maxcarlson at Roboto on 2008-07-07 15:58:31 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Fix text height measurement in swf8
Bugs Fixed: LPP-6619 - LzText Element Not Resizing On Subsequent Fontsize Changes
Technical Reviewer: promanik
QA Reviewer: a.bargull at intensis.de
Details: Turn on autosize before measurement, and set to a default test string if we get an empty field.
Tests: test/lztest/lztest-textheight.lzx?debug=true&lzr=swf8 runs as before, and LPP-6619 testcase passes in both swf and dhtml.
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as 2008-07-07 23:24:27 UTC (rev 10238)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as 2008-07-07 23:36:35 UTC (rev 10239)
@@ -257,7 +257,25 @@
* in the DHTML version of this method).
*/
LzTextSprite.prototype.getTextfieldHeight = function ( ){
- return this.__LZtextclip._height;
+ var textclip = this.__LZtextclip;
+
+ // turn on autoSize temporarily
+ var tca = textclip.autoSize;
+ textclip.autoSize = true;
+ // measure height and reset to the original values
+ var h = textclip._height;
+
+ // Measure test string if the field is empty
+ if (h == 4) {
+ var tct = textclip.htmlText;
+ textclip.htmlText = "__ypgSAMPLE__";
+ var h = textclip._height;
+ textclip.htmlText = tct;
+ }
+
+ textclip.autoSize = tca;
+
+ return h;
}
/**
More information about the Laszlo-checkins
mailing list