NSScrollView in CaLayer small redraw issues
NSScrollView in CaLayer small redraw issues
- Subject: NSScrollView in CaLayer small redraw issues
- From: Oriol Ferrer MesiĆ <email@hidden>
- Date: Sun, 30 Aug 2009 22:03:53 +0200
Hi, I'm working on an app that allows the user to change the size of a
textView.
I want the user to be able to change the font of the textview, and I
want the textview to fadeout and fadein when changing it. To do so, I
need to drop the alpha of the textView, and to do so, it needs to be
embedded into a CALayer.
I am aware that NSScrollView's assign a CATiledLayer to it's
contentViews (the textview), so that's why I decided that it would be
better to make the NSScrollView a CALayer, as this shouldn't give the
"google maps loading" effect to my text. Is this a good approach?
So I [scrollView setWantslayer:YES]; and it works fine, but there are
some redraw issues. The top part gets garbled, and it seems to be
redrawing twice. The problems seems to show up on the text that's
above the text caret only.
I recorded a video of it:
http://uri.cat/dontlook/NSScrollView.mov
I've also tried wrapping the whole nsscrollview into a custom nsview,
and setting only the nsview as CALayer, with the same results. I am
not forcing redraws in any of my subviews either... I'm quite lost.
I've also used QuartzDebug to check what and when things are redrawn
(flash screen updates), and it seems like as soon as I embed my
NSScrollView subclass into a CALayer, it's continuously redrawn; even
with no user interaction. Seems to redraw continiously when the caret
is drawn, and it doesnt redraw when the caret is hidden. So it
alternates (1 second no redrawing, 1 second full-speed redrawing).
That doesn't happen when the NSScrollView is not set to use a CALayer
[scrollView setWantslayer:NO]; so I don't think it's an issue with my
subclasses of ClipView or NSTextView.
The only thing I need to do is fade out the textView really, so if
there's a way to fade an NSView without having to go through CALayers
then I'm happy to do so.
Thanks for reading this!
//
// Oriol Ferrer MesiĆ
// http://uri.cat
//
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden