Improved stack scaling?
Posted: Thu May 20, 2010 3:15 pm
I'm trying to simulate the Mac OS X behavior with windows changing size via animation. But the animations are way to slow
To get it working somewhat I lower the iterations to 10 which makes a compromise between speed and fluidity. Anyone know of a better way? When I resize a stack via the mouse it's instant and fluid if I set the liveResizing to true!
When timing my window it takes ~150 ms to go from big to small and ~320 ms from small to big.
Here's the code:

When timing my window it takes ~150 ms to go from big to small and ~320 ms from small to big.
Here's the code:
Code: Select all
on animateResize endWidth, endHeight
put the width of this stack into startWidth
put the height of this stack into startHeight
put (endWidth - startWidth) / 10 into widthStep
put (endHeight - startHeight) / 10 into heightStep
put the top of this stack into myTop
put the left of this stack into myLeft
lock messages
repeat with i = 1 to 10
add widthStep to startWidth
add heightStep to startHeight
lock screen
set the width of this stack to startWidth
set the height of this stack to startHeight
set the top of this stack to myTop
set the left of this stack to myLeft
unlock screen
end repeat
unlock messages
// Ensure that the size is correct
lock screen
set the width of this stack to endWidth
set the height of this stack to endHeight
unlock screen
end animateResize