• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextView overdraw bug in Leopard?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView overdraw bug in Leopard?


  • Subject: Re: NSTextView overdraw bug in Leopard?
  • From: Martin Wierschin <email@hidden>
  • Date: Fri, 15 Aug 2008 20:10:40 -0700

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@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


  • Follow-Ups:
    • what is radar:// supposed to open?
      • From: Roland King <email@hidden>
  • Prev by Date: Using Flex/Lex in a Cocoa project
  • Next by Date: Re: Race in Apple's NSTreeContoller/NSOutlineView
  • Previous by thread: Re: Using Flex/Lex in a Cocoa project
  • Next by thread: what is radar:// supposed to open?
  • Index(es):
    • Date
    • Thread