[Laszlo-dev] for review, fix for LPP-4248 text height recomputing too spontaneously

Henry Minsky henry.minsky at gmail.com
Thu Jul 19 15:16:00 PDT 2007


Maybe you got the wrong patch, lemme send again.

The change is just two lines, I changed the check that was

-    if (!('height' in args) || (args.height == null)) {

to instead be
+    if (!this.hassetheight) {

LzView has already computed hassetheight, and that computation factors in if
there is a constraint on height, which the simple "!('height' in args) || (
args.height == null))" test did not do.



===================================================================
--- LzText.lzs    (revision 5701)
+++ LzText.lzs    (working copy)
@@ -233,7 +233,7 @@
     //    if  single line, use font line height
     //    else get height from flash textobject.textHeight
     //
-    if (!('height' in args) || (args.height == null)) {
+    if (!this.hassetheight) {
         this.sizeToHeight = true;
     }  else {
         this.setHeight(args.height);
@@ -381,7 +381,6 @@
     // recalculate height
     if (this.sizeToHeight) {
         var h = this.sprite.getTextfieldHeight();
-        //Debug.write('LzText.setText computed height', h, this.sprite);
         if (h > 0) {
             this.setHeight(h);
         }
@@ -659,7 +658,6 @@
     //resizable fields adjust their height
     if (this.sizeToHeight) {
         var h = this.sprite.getTextfieldHeight();
-        //Debug.write('LzText.setText computed height', h, this.sprite);
         if (h > 0) {
             this.setHeight(h);
         }


On 7/19/07, P T Withington <ptw at openlaszlo.org> wrote:
>
> Can you explain this change?  I would have thought the
> super.construct would have already correctly compute hassetheight
> from args.  Why are you having to recompute it from scratch here?
>
> On 2007-07-19, at 15:30 EDT, Henry Minsky wrote:
>
> > Change 20070719-hqm-6 by hqm at IBM-2E06404CB67 on 2007-07-19 15:26:44
> > EDT
> >    in /cygdrive/c/users/hqm/openlaszlo/legals3/WEB-INF/lps/lfc
> >    for http://svn.openlaszlo.org/openlaszlo/branches/legals/WEB-INF/
> > lps/lfc
> >
> > Summary: fix for text sizing in DHTML
> >
> > New Features:
> >
> > Bugs Fixed: LPP-4248
> >
> > Technical Reviewer: max (pending)
> > QA Reviewer: (pending)
> > Doc Reviewer: (pending)
> >
> > Documentation:
> >
> > Release Notes:
> >
> > Details:
> >
> >
> > Multiline text should not try to resize it's height automatically
> > if there
> > are
> > any constraints on it's height (or if it's height is set to a
> > constant)
> >
> > Tests:
> >
> > test case in bug report
> >
> > Files:
> > M      views/LzText.lzs
> >
> >
> > Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20070719-
> > hqm-6.tar
> >
> > --
> > Henry Minsky
> > Software Architect
> > hminsky at laszlosystems.com
>
>


-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20070719/b3873444/attachment-0001.html


More information about the Laszlo-dev mailing list