Question: I wonder if the test `width == 0` should have been `hassetwidth == false`? And you should ensure that setting `width` to 0 sets `hassetwidth` to true?
Or are we sure _updateSize can never be called if hassetwidth is true? On 2010-04-12, at 23:30, Henry Minsky wrote: > Change 20100412-hqm-M by [email protected] on 2010-04-12 23:18:06 EDT > in /Users/hqm/openlaszlo/trunk1 > for http://svn.openlaszlo.org/openlaszlo/trunk > > Summary: GHQ-53457-739: set width to 0 for text view still show the text in > swf9 > > New Features: > > Bugs Fixed: LPP-8813 > > Technical Reviewer: max > QA Reviewer: ptw, andre > Doc Reviewer: (pending) > > Documentation: > > Release Notes: > > Overview: > > > Details: > > WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as > + fixed incorrect test for w != null > > > WEB-INF/lps/lfc/views/LzText.lzs: > > + in _updateSize(), there was an 'if' statment that decides whether to > autosize the width to the text width, and it said that any text with > width == 0 should be auto resized. This seems wrong, so I removed that > clause. > > Tests: > > (I missed one of the points of the original bug report which was that the > '...' were visible > right after app startup, even though a width of zero was being set in the > oninit method.) > > Test case must also be modified to set resize="false" on the 'dots' text > field, or else > the text will get sized to the width of the content at instantiation time. > > <canvas height="500" width="100%"> > <view width="100" height="100" bgcolor="blue"> > <simplelayout axis="y" spacing="3"/> > <text name="dots" text="..." bgcolor="red" > oninit="this.setAttribute('width', 0);"/> > <button name="width0" text="change width to 0"> > <handler name="onclick"><![CDATA[ > parent.dots.setAttribute("width", 0); > ]]> > </handler>. > </button> > <button name="width20" text="change width to 20"> > <handler name="onclick"><![CDATA[ > parent.dots.setAttribute("width", 20); > ]]> > </handler>. > </button> > > </view> > </canvas> > > > Tests: > + Observe that the "..." do not appear at app startup > + Dots appear with red bgcolor when width is set to 20. > + Dots and bgcolor disappear when width is set to zero > > > Files: > M WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as > M WEB-INF/lps/lfc/views/LzText.lzs > > > Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100412-hqm-M.tar >
