Clip/ScrollView image scrambling
Clip/ScrollView image scrambling
- Subject: Clip/ScrollView image scrambling
- From: Scott Thompson <email@hidden>
- Date: Mon, 8 May 2006 19:08:32 -0500
In our application, we have overridden the default clip view for a
scroll view in the main window. Our clip view has special behavior
in that it tries to keep the same point at the center of the view as
the user resizes it.
In order to implement this behavior, we have overridden setViewSize
like this:
- (void) setViewSize: (NSSize) viewSize
{
<some calculations related to finding the center of the view>
[self setViewSize: viewSize];
[self scrollToPoint: someNewPointThatCentersThingsAgain];
}
By in large this code works fine. Things go wrong, however, if you
resize the view and then immediately touch one of the scroll bars.
What you get in that case, is a display that looks like a small part
of the view repeated over and over, smearing across the display.
If I had to guess I would say that the size of this smeared area
looks to be the same as the size of the last resize increment.
My curren theory is that the scrollToPoint after the setViewSize is
not completing whatever magic the NSClipView needs to feel good about
itself. I think what's happening is that the clip view's cached
image is getting scrambled. Then when you touch the scroll bar the
system copies this bogus image to the display, obscuring what was
there with garbage.
This theory is bolstered by the fact that if we turn off
"copiesOnScroll" the problem goes away. Unfortunately, the content
of that view can be complex enough that turning it off is not a
workable option.
It occurs to me that if I could convince the clip view to flush and/
or regenerate it's cached image that it would solve the issue. Does
anyone know of a way to convince the clip view to regenerate it's
cached image?
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden