Red spelling underline draws incorrectly in layer-backed views
Red spelling underline draws incorrectly in layer-backed views
- Subject: Red spelling underline draws incorrectly in layer-backed views
- From: Kyle Sluder <email@hidden>
- Date: Mon, 8 Nov 2010 16:05:43 -0800
Hi list,
We've been trying to track down a bug in our CALayer-based view in
which the red dotted underlines for misspellings appear in the wrong
place. It looks like they're being drawn in an unflipped graphics
context, even though we're drawing the text into a CABitmapContext
we've created ourselves.
While working on an unrelated bug, I created a simple NIB file that
contained a layer-backed NSTextView inside a layer-backed NSScrollView
that's set to automatically resize with its window. Simulating the
interface (Cmd-R in Interface Builder) showed that even this is
broken. The red underlines repeat themselves horizontally across the
view and leave artifacts around when the text is deleted. Furthermore,
if you drag the window resize handle up to shrink the window, the text
stays put but the red underlines start sliding about, fixing
themselves when you let go of the resize handle.
It looks like NSLayoutManager and CALayer just don't mix. I've filed a
radar at rdar://problem/8644121. I'm also curious if this is related
to rdar://problem/8009542 (Scroll view misbehaves with flipped
layer-hosting document view), since text views are flipped.
I've put a demo project up at
http://dl.dropbox.com/u/9699077/CARedSpellingUnderline.zip and a
screenshot at http://dl.dropbox.com/u/9699077/CARedSpellingUnderline.png
.
Has anyone else seen anything similar to this and/or has ideas for a workaround?
Thanks,
--Kyle Sluder
_______________________________________________
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