Hi list...
I'm working on a handler for a window with a maximize button where
clicking it stretches out the rect and drawRect of the MIAW to fit the
screen. It works, but it's really choppy. Is there anything I can do
to the math here that will help to smooth out my transition?
Thanks,
- Michael M.
on resizeMIAW()
gData.pViewPref = not gData.pViewPref -- boolean, toggles in normal
size or full screen
case gData.pViewPref of
FALSE:
-- make sure maximized projector's drawrect is same aspect ratio
as original 800x600 (1.333:1)
-- values on next line are based on baScreenInfo("width" and
"height")
if gData.pScreenInfo.pWidth <= gData.pScreenInfo.pHeight then
-- not done yet
else
startValue = gData.pScreenInfo.pHeight
repeat with newHeight = startValue down to 1
newWidth = integer(newHeight * 1.333) -- 1.333 is aspect ratio
of the stage
if (newWidth < gData.pScreenInfo.pWidth) then exit repeat
end repeat
-- stretch as full screen as possible
coeff = 1.4
repeat with incrementHeight = (the stage).rect.height to
newHeight--(the stage).rect.height to newHeight
incrementWidth = integer(incrementHeight * 1.333)
theL = integer(float(gData.pScreenInfo.pWidth -
incrementWidth)/2)
theT = integer(float(gData.pScreenInfo.pHeight -
incrementHeight)/2)
theR = integer((float(gData.pScreenInfo.pWidth -
incrementWidth)/2) + incrementWidth)
theB = integer((float(gData.pScreenInfo.pHeight -
incrementHeight)/2) + incrementHeight)
(the stage).rect = rect(theL, theT, theR, theB)
(the stage).drawRect = rect(0,0,(the stage).rect.width, (the
stage).rect.height)
incrementHeight = incrementHeight * coeff
coeff = coeff * .9
if (incrementHeight > newHeight) then
incrementHeight = newHeight
end if
end repeat
end if
-- end if
TRUE:
nothing -- yet
end case
end
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[email protected] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]