[Laszlo-dev] For Review: Change 20090227-ptw-e Summary: Correct implementation of LzText/getTextSize
André Bargull
andre.bargull at udo.edu
Sat Feb 28 05:53:10 PST 2009
If LzView#getTextHeight() is supposed to return the text-height instead
of the line-height, the test needs to be fixed. But also see LPP-4651
(getTextHeight() measures the height of an entire text field instead of
a single line of text.).
Here's one broken test:
---
<canvas debug="true">
<dataset name="dstext" >
<text>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Nunc ac ante sed ante imperdiet auctor.</text>
<text>Lorem ipsum dolor sit amet</text>
</dataset>
<text id="a" datapath="dstext:/text[1]/text()" multiline="true"
resize="false" width="120" height="40" bgcolor="#eaeaea" />
</canvas>
---
In 3.4:
- a.__LZtextclip.textHeight returns 91.
- a.__LZtextclip.textWidth returns 111
- a.getTextHeight() returns 91
In trunk (without Tucker's changes):
- a.sprite.__LZtextclip.textHeight returns 78
- a.sprite.__LZtextclip.textWidth returns 117
- a.sprite.getTextfieldHeight() returns 82
- a.sprite.getTextHeight() returns 13
- a.getTextHeight() returns 13
(note: only in trunk, a.sprite.__LZtextclip.text has got a trailing \r)
So, the results in trunk did never match the results from 3.x
On 2/28/2009 2:07 PM, Max Carlson wrote:
> Wait - I'm not sure we should be fixing lztest-textheight - the vslues
> there represent the behavior from 3.x, and I think we want to try to
> remain backward compatible as much as possible...
>
> André Bargull wrote:
>> Approved (with the necessary changes to lztest-textheight.lzx, as
>> outlined by Max).
>>
>> So for the record:
>> LzView#getTextHeight() delegates to LzSprite#getTextfieldHeight()
>> which returns the height of the text (with the 2px flash-gutter). Right?
>>
>>
>> On 2/27/2009 9:05 PM, P T Withington wrote:
>>> Change 20090227-ptw-e by ptw at dueling-banjos.home on 2009-02-27
>>> 14:50:27 EST
>>> in /Users/ptw/OpenLaszlo/trunk-3
>>> for http://svn.openlaszlo.org/openlaszlo/trunk
>>>
>>> Summary: Correct implementation of LzText/getTextSize
>>>
>>> Bugs Fixed: LPP-7569 Text in scrolledittext flips after 13 characters.
>>>
>>> Technical Reviewer: a.bargull at intensis.de, max (pending)
>>> QA Reviewer: aalappat at laszlosystems.com (pending)
>>>
>>> Details:
>>> *: Note LPP-7832
>>>
>>> LzInputTextSprite.as: Remove incorrect override of
>>> getTextfieldHeight
>>>
>>> LzText: call correct kernel API
>>>
>>> Tests:
>>> Test case from bug report, smokecheck, sample apps
>>>
>>> Files:
>>> M WEB-INF/lps/lfc/kernel/swf/LzTextSprite.as
>>> M WEB-INF/lps/lfc/kernel/swf/LzInputTextSprite.as
>>> M WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
>>> M WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
>>> M WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
>>> M WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
>>> M WEB-INF/lps/lfc/views/LzText.lzs
>>>
>>> Changeset:
>>> http://svn.openlaszlo.org/openlaszlo/patches/20090227-ptw-e.tar
>>>
>
More information about the Laszlo-dev
mailing list