I don't see how this helps any. The first time the layout is run (assumming
on x), the x coordinate of the views are changed. When the layout axis is
changed to y, the proposed change is fetching the x coordinate from the
view and setting it to the same value. Isn't this statement,
s.setAttribute(o, s[o])
just a nop (or am I missing something)?
Phil
>Bruce has added a different proposed change to LPP-2091. Would you
>and Max mind taking a look and sending your comments to the list?
>
>But I think there's an improvement to be made to that diff. Instead of
>
>var f;
>if (o=="y") {f=s.y;}
>else {f=s.x;}
>
>s.setAttribute( o , f);
>
>I think you could just do
>
>s.setAttribute(o, s[o]);
>
>jim
>
>On May 30, 2006, at 12:08 PM, Philip Romanik wrote:
>
> > The change has been backed out, but the behavior is still broken.
> > In a static situation, it works correctly. Running this,
> >
> > <canvas height="100">
> > <view >
> > <simplelayout axis="x" spacing="10"/>
> > <view bgcolor="blue" y="10" height="30" width="50"/>
> > <view bgcolor="blue" y="20" height="30" width="50"/>
> > <view bgcolor="blue" y="30" height="30" width="50"/>
> > </view>
> > </canvas>
> >
> > works as expected. However, when you dynamically change the axis,
> > the old value for coordinate is not reset to its previous value. I
> > now understand why the coordinate of the other axis was set to 0.
> > In order to fix this properly the object needs to keep track of the
> > old coordinates.
> >
> > This example shows how the layout is broken:
> >
> > <canvas height="600" debug="true">
> > <view>
> > <method event="onclick">
> > sl.axis = (sl.axis == "x") ? "y" : "x";
> > sl.update();
> > </method>
> > <simplelayout id="sl" axis="x" spacing="10"/>
> > <view id="v1" bgcolor="blue" height="30" width="50"/>
> > <view id="v2" bgcolor="blue" height="30" width="50"/>
> > <view id="v3" bgcolor="blue" height="30" width="50"/>
> > </view>
> > </canvas>
> >
> > When you click on the view, the axis changes from x to y. The x
> > coordinates maintain the value they had when simplelayout first ran.
> >
> > Also, the call to update() was removed in the setAxis method (as
> > part of backing out the change). The user has to manually call
> > update() in order to see the changes.
> >
> >
> > Phil
> >
> >
> >> Approved, pending fixes to line endings in layouttest.lzx... Sorry I
> >> missed this the first time!
> >>
> >> --
> >> Regards,
> >> Max Carlson
> >> OpenLaszlo.org
> >>
> >> Jim Grandy wrote:
> >> > Change 42573 by [EMAIL PROTECTED] on 2006/05/29 20:51:18
> >> *pending*
> >> >
> >> > Summary:Back out most of change 42068, since it causes
> >> > simplelayout
> >> > misbehavior
> >> >
> >> > Bugs Fixed:LPP-2091
> >> >
> >> > Technical Reviewer: max
> >> > QA Reviewer: promanik
> >> > Doc Reviewer:
> >> >
> >> > Release Notes:
> >> >
> >> > Tests:
> >> >
> >> > Affected files ...
> >> >
> >> > ... //depot/lps-3.3/lps/components/utils/layouts/simplelayout.lzx#1
> >> > edit ... //depot/lps-3.3/test/components/layouttest.lzx#1 edit
> >> >
> >>
> >
_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev