• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Clip/ScrollView image scrambling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Clip/ScrollView image scrambling
      • From: Scott Thompson <email@hidden>
    • First click when activated
      • From: Valerio Ferrucci <email@hidden>
References: 
 >Clip/ScrollView image scrambling (From: Scott Thompson <email@hidden>)

  • Prev by Date: Re: How to include a framework in a custom IB Palette
  • Next by Date: First click when activated
  • Previous by thread: Clip/ScrollView image scrambling
  • Next by thread: First click when activated
  • Index(es):
    • Date
    • Thread