[Laszlo-dev] For Review: Change 20070119-maxcarlson-N Summary: Make canvas resizing work in both SWF and DHTML

Philip Romanik promanik at laszlosystems.com
Sat Jan 20 11:06:26 PST 2007


Sure. I'll look at it now.

Phil


>Any chance you can review my change that fixes smoketest?  I'd really
>like to get it in...
>
>-Max
>
>Philip Romanik wrote:
> > Hi Max,
> >
> > I wrote a sample app and it doesn't run as expected. The app displays
> > the width/height of the canvas whose size is set to width=75%,
> > height=50%. When I resize the browser window, it updates. The width
> > looks fine, but the height isn't always correct. I'm running on Windows.
> > If I change the height to 100%, things work much better.
> >
> >
> > IE6: swf/dhtml Reported height looks wrong (the values displayed are
> > 50-60 rather than an expected 400-500). The height looks corrects dhtml
> > when debug=1
> >
> > IE7: swf/dhtml. Reported height fixed at 198 (50% of 396)
> >
> > FF 1.5/2: swf/dhtml: height fixed at 200 (50% of 400)
> >
> >
> > <canvas width="75%" height="50%" bgcolor="0xe0e0e0">
> >   <simplelayout axis="y"/>
> >   <text name="msg" width="100%"/>
> >
> >   <view width="100%" height="100%" bgcolor="0xa0a0a0">
> >     <text name="vmsg" width="100%"/>
> >     <method name="vmessage">
> >       vmsg.setText (parent.format(this.width, this.height));
> >     </method>
> >     <method event="oninit">vmessage();</method>
> >     <method event="onwidth">vmessage();</method>
> >     <method event="onheight">vmessage();</method>
> >   </view>
> >
> >   <method name="format" args="w,h">
> >     return "Width: " + w + ", Height: " + h;
> >   </method>
> >
> >   <method name="message">
> >     msg.setText (this.format (this.width, this.height));
> >   </method>
> >   <method event="oninit">message();</method>
> >   <method event="onwidth">message();</method>
> >   <method event="onheight">message();</method>
> > </canvas>
> >
>
>--
>Regards,
>Max Carlson
>OpenLaszlo.org



More information about the Laszlo-dev mailing list