NSScollView with inverted documentView causing unusual animation problems

I am going through a strange thing. I'm working on a project that started noticing this problem, so I created a test case to simplify the problem and see if I can figure it out.

I have a document based application with one window controller. inside which are the following objects:

  • Subclassing NSScrollView with isFlipped = YES
  • Subclass of NSView with isFlipped = YES, this is the documentView in the above scroll.
  • NSImage in Document View

Then I try and fade the image to alpha 0 like this:

- (void)windowDidLoad {
    [super windowDidLoad];
    [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(test) userInfo:nil repeats:FALSE];
}

- (void) test {
    [NSAnimationContext beginGrouping];
    [[NSAnimationContext currentContext] setDuration:4];
    self.errorOutline.animator.alphaValue = 0;
    [NSAnimationContext endGrouping];
}

      

This is how it looks in Xcode:

Xcode Layout

This is what happens when it starts animation:

While animating it breaks up

I noticed that if I constantly resize the window during the animation, I get a halo image, similar to the effect where I can see the rest of the image.

Another weird problem is that if I set isFlipped = NO, then the problem does not occur. What's not an option - the whole reason I'm looking at the view is to make it easier to manage the addition of cells to it without calculating positions and heights back.

Update: I logged a radar bug as it is a really weird problem. http://openradar.appspot.com/20680289

+3


source to share





All Articles