Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Strangeness with ScrollRect and QDFlushPortBuffer



I'm seeing behavior which I'm starting to suspect is an OS X bug:

My application sports a nice visual effect of sliding a portion of the
window's content area up or down in the window, in response to clicks in
buttons. To accomplish the sliding effect, I call, in a loop, ScrollRect
followed by QDFlushPortBuffer, where the rectangle's vertical position is
offset by one pixel each time through the loop, as in this pseudocode:

Boolean slideUp = true;
Rect rect = {0, 0, 50, 50};
for (short i=0; i<50; i++) {
StRegion updateRgn;
::ScrollRect(&rect , 0, slideUp ? -1 : 1, updateRgn);
::OffsetRect(&rect , 0, slideUp ? -1 : 1);
::QDFlushPortBuffer(GetMacPort(), updateRgn);
}

The visual effect of this is that you see that rectangular portion of the
window slide up or down on the screen.

Now here's the strangeness: When the window is located near the top of the
screen, the slide is seen to be nice and zippy. But if I move the window
close to the bottom of the screen, it is much slower. In fact, there is a
continuum: the closer the window is to the bottom of the screen, the slower
the slide effect is. I haven't the faintest clue why the window's position
on the screen should have any effect on the speed of the slide effect. All
I know is that if omit calling QDFlushPortBuffer, the slowness disappears
(but then, so does the slide effect, because this window is indeed
buffered). Can anyone shed any light on this? Is it an OS bug, as I
suspect? (I'm seeing this on OS X).

--
Larry Gerndt
AIM Handle: SonOfTheSonOfMan
Let the truth be told though the heavens fall -- James Garrison
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.