Re: Clip/ScrollView image scrambling
Re: Clip/ScrollView image scrambling
- Subject: Re: Clip/ScrollView image scrambling
- From: "I. Savant" <email@hidden>
- Date: Tue, 9 May 2006 08:50:22 -0400
You're probably better off to actually post the "some calculations
related to finding the center of the view" and anything else you've
changed in your subclass.
Otherwise, my best guess is my own memory of a similar problem. It
was of course my own fault - I had a temporary iVar in which I stored
some special view metrics. Sort of a "last state" indicator. This was
not properly updated when the window (and as a result, the view) was
resized. The next time it scroll view scrolled, the view's drawing
was skewed.
I had since trashed that approach as I had found a more efficient
approach to my particular problem. Either way, it's difficult to say
what the problem is in your case until we know exactly how you've
changed the behavior in your subclass. :-)
--
I.S.
On May 8, 2006, at 8:08 PM, Scott Thompson wrote:
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:
40gmail.com
This email sent to email@hidden
_______________________________________________
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