Replying to myself for the sake of the archives.

We've had a report or two from users where text will incorrectly draw in an area it's not supposed to. Basically a line fragment (or part of one) from the prior NSTextContainer will draw over text in the current container.

We did manage to reproduce this and narrowed the problem down to characters that cause container break actions in the typesetter (eg: page break character U+000C). Another user also contacted me off list with steps that reproduces the issue in a vanilla TextEdit. It's definitely a bug in the text engine, and as far as I can tell it's new for Leopard.

Specifically the bad redraw is caused by NSLayoutManager's glyphRangeForBoundingRect reporting wrong glyph ranges. The glyph range returned can be completely outside of the glyph range reported by glyphRangeForTextContainer. So the (slow) solution is to override NSTextView's drawRect so as to redraw all glyphs in the entire container without calling super. I'm not sure if the incorrect bounding rect information leads to other more subtle bugs.

Submitted to Apple as radar://6154039

~Martin

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to