[Laszlo-dev] SOLO Swf Resize while Preserving Aspect Ratio

Henry Minsky henry.minsky at gmail.com
Sat Jan 28 20:20:33 PST 2006


Those changes *are* in the dev branch, I thought that they had made it into
the last 3.1 and later releases...


On 1/28/06, Aaron Shepherd <aaron.shepherd at guestclick.com> wrote:
>
> The change Henry suggested worked like a charm.  There are some
> anomalies with view resizing, but in general I would suggest the minor
> changes Henry provided would make an excellent addition to the Laszlo
> platform.
>
> Thanks again Max and Henry.
>
> -Aaron
>
> -----Original Message-----
> From: Max Carlson [mailto:max at laszlosystems.com]
> Sent: Friday, January 27, 2006 1:28 PM
> To: Henry Minsky
> Cc: Aaron Shepherd; laszlo-dev at openlaszlo.org
> Subject: Re: [Laszlo-dev] SOLO Swf Resize while Preserving Aspect Ratio
>
> Henry is right.  Unfortunately, we had to force to stage to align=lt and
>
> scale=Noscale to get consistent behavior across browsers.  We need put
> in an escape hatch where these settings can be overridden by passing in
> canvassalign and/or canvasscale in on the query string at startup.
>
> I've attached an html wrapper page that shows the noScale stretches
> being applied.  Let me know if you have any questions.  Thanks!
>
> Regards,
> Max Carlson
> OpenLaszlo.org
>
> Henry Minsky wrote:
> > I remember there was some issue where this came up , or something
> > related, and it had to do with the LFC library setting the scale
> > parameters or something.
> >
> > In the file
> >
> > WEB-INF/lps/lfc/view/LaszloCanvas.as
> >
> > There is this line
> >
> > // necessary for consistent behavior - in netscape browsers HTML is
> ignored
> > Stage.align = global.canvassalign != null ? global.canvassalign :
> "LT";
> > Stage.scaleMode = global.canvasscale != null ? global.canvasscale :
> > "noScale";
> > //_root.Debug.write('Canvas scale', global.scale, Stage,
> Stage.scaleMode);
> >
> >
> > Maybe that has something to do with it?
> >
> >
> > On 1/26/06, *Aaron Shepherd* <aaron.shepherd at guestclick.com
> > <mailto:aaron.shepherd at guestclick.com>> wrote:
> >
> >     The problem isn't with the embed.js, since I'm not actually using
> that.
> >
> >     The problem is with the SWF file that is generated through the
> Laszlo
> >     compiler.  It must contain a setting for the scale option that is
> not
> >     allowing for scaling while preserving the aspect ratio.
> >
> >     If I set the scale=showingall in the embed tag, set the width and
> height
> >     on the embed tag to 100%, then I want the app to scale to the
> browser
> >     width/height with aspect.  If you do this with a "normal" flash
> file,
> >     like any of the example "working" swf files in the demos, it works
> the
> >     way I want the Laszlo outputted swf files to work.
> >
> >     I'm sure there is a setting somewhere in the SWF writing classes
> (or
> >     perhaps in the compiler source), that controls this functionality.
> >
> >     I just need to find the right 2 lines of code :)
> >
> >     Thanks,
> >
> >     Aaron
> >
> >
> >     -----Original Message-----
> >     From: P T Withington [mailto:ptw at pobox.com <mailto:ptw at pobox.com>]
> >     Sent: Thursday, January 26, 2006 7:05 PM
> >     To: Aaron Shepherd
> >     Cc: laszlo-dev at openlaszlo.org <mailto:laszlo-dev at openlaszlo.org>
> >     Subject: Re: [Laszlo-dev] SOLO Swf Resize while Preserving Aspect
> Ratio
> >
> >     embed.js is very tricky to work with.  You could try
> ?lzt=html-object
> >     and look at the source to play with the plug-in options; or, maybe
> >     you just want to set the canvas width/height to 100%, which will
> >     cause it to size to the plug-in?
> >
> >     On 26 Jan 2006, at 18:17, Aaron Shepherd wrote:
> >
> >      > I have a rather complex application that we are deploying in
> SOLO
> >      > mode that I would like to automatically resize with preserving
> the
> >      > aspect ratio.  I don't want to use constraints as not all
> >      > components (like tabs, tabsliders, etc) auto-constrain font
> sizes,
> >      > etc.
> >      >
> >      > I would like to set the sizes manually (at least of the canvas
> and
> >      > outer most views), and have the flash player take care of the
> >      > scaling as it supports scaling with aspect preservation. This
> >      > allows complete control of the application look/feel and allows
> me
> >      > to develop at a higher resolution (like 1280x1024 to get the
> ratios
> >      > correct), but still deploy at any size client's browser is
> >      > configured.  (With special note to the 640x480 screens, which
> make
> >      > most modern applications look terrible).
> >      >
> >      > I also need the application to look good with any size or
> aspect of
> >      > window. So... Why is it that the SWF files generated from
> Laszlo do
> >      > not respect the aspect scale defaults of the flash player?
> Other
> >      > applications/swf files that are pure flash do so.
> >      >
> >      > Is there a way to have the generated solo swf file respect the
> >      > scale attribute of the flash player?
> >      >
> >      > Do I need to modify the Java sources used to compile the swf
> files?
> >      >
> >      > I'm not shy about changing the underlying laszlo source or swf
> >      > generation pieces, and would be happy to repost the mods to
> support
> >      > this functionality.
> >      >
> >      > A very simple example is:
> >      >
> >      > [canvas width="1024" height="768" proxied="false"]
> >      > [view width="${parent.width}" height="${ parent.height}"]
> >      > [text]Here is some text[/text]
> >      > [/view][/canvas]
> >      >
> >      > When run as an embedded swf, or even a standalone swf, the
> aspect
> >      > ratio specified is not respected.
> >      >
> >      > Things I have tried with no effect:
> >      > -         Modified the embed tags in my deployment HTML to have
> >      > scale=showall.
> >      >
> >      > -         Modified the base xslt stylesheets provided in the
> distro
> >      > from scale=noscale to scale=showall
> >      >
> >      > -         Modified all the html/js files with respect to any
> and
> >      > all scale= tags
> >      >
> >      >
> >      > I know that most applications would dynamically stretch to fit
> a
> >      > page and utilize more real estate for functional areas, and in
> fact
> >      > we have other applications that work in that manner.  But since
> >      > this an end-user consumer oriented application (think TIVOish),
> I
> >      > need the application to look/act/feel the same regardless of
> the
> >      > deployment environment.
> >      >
> >      > Thanks in advance for any insight into this question.
> >      >
> >      > -Aaron
> >      >
> >      >
> >      >
> >      >
> >      > _______________________________________________
> >      > Laszlo-dev mailing list
> >      > Laszlo-dev at openlaszlo.org <mailto:Laszlo-dev at openlaszlo.org>
> >      > http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
> >
> >
> >
> >
> >
> >     _______________________________________________
> >     Laszlo-dev mailing list
> >     Laszlo-dev at openlaszlo.org <mailto:Laszlo-dev at openlaszlo.org>
> >     http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
> >
> >
> >
> >
> > --
> > Henry Minsky
> > Software Architect
> > hminsky at laszlosystems.com <mailto:hminsky at laszlosystems.com>
> >
> >
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Laszlo-dev mailing list
> > Laszlo-dev at openlaszlo.org
> > http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
>
>
>
>


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


More information about the Laszlo-dev mailing list