I put NSTextView + NSImageView + NSMatrix + NSTextView in a NSScrollView. And I scroll this scrollview to top using following code -
NSPoint pointToScrollTo = NSMakePoint(0, NSMaxY([[singleScrollView documentView] frame]) - [[singleScrollView contentView] bounds].size.height);
[[singleScrollView contentView] scrollToPoint: pointToScrollTo];
[singleScrollView reflectScrolledClipView: [singleScrollView contentView]];
But the problem is when it finish scrolling to top the view gets messed up.. Here is a screenshot -
I tried to force redraw contents with no luck using this -
[txtQTitle setNeedsDisplay:YES];
[viewOptions setNeedsDisplay:YES];
[singleScrollView setNeedsDisplay:YES];
Do anyone have any idea why this is causing and how should be solved?
Edit 1 - When I scroll the view using mouse scroll some part of the singleScrollView gets ok .. here is a screenshot of this -