• 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
NSLineBreakByClipping is not clipping
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSLineBreakByClipping is not clipping


  • Subject: NSLineBreakByClipping is not clipping
  • From: Seth Willits <email@hidden>
  • Date: Mon, 7 Sep 2009 14:38:44 -0700


I'm drawing an attributed string with drawInRect which is documented to clip to the rect you pass in. The line break mode of the paragraph style is NSLineBreakByClipping. If the string's text is too wide for the rect (even by a lot), it draws outside of the rect. I've noticed that this only happens if the string will not vertically clip the text with the given rectangle. In other words, if there's enough vertical room for the text but not enough horizontal room, it will not clip the text. If there's not enough vertical room and not enough horizontal room, both axis are properly clipped to the rect.


I've also noticed that if I use NSLineBreakByTruncatingTail, it works fine all the time.


Screenshot: http://www.sethwillits.com/temp/StringClippingBug.png Code: http://www.pasteit4me.com/32015



Is this a bug?

--
Seth Willits



_______________________________________________

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


  • Prev by Date: Re: Menu Weirdness (can't set command + 3 or command + 4)
  • Next by Date: Re: Need simple port scan
  • Previous by thread: Re: Need simple port scan
  • Next by thread: NSKeyedUnarchiver and memory management
  • Index(es):
    • Date
    • Thread