• 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: NSString drawInRect clipping control
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString drawInRect clipping control


  • Subject: Re: NSString drawInRect clipping control
  • From: Markus Hitter <email@hidden>
  • Date: Wed, 23 Jan 2002 17:47:10 +0100

Am Mittwoch den, 23. Januar 2002, um 14:18, schrieb Mark's Studio:

Thanks for your reply

Yes i do want clipping.
im drawing into a view used for printing
so the size of the rect will change with different paper size

I want the same clipping as when there is no spaces in the string.

This is what I meant:

NSMutableString *tmpString = [printString mutableCopy];

while ([tmpString sizeWithAttributes:attributes].width > textRect.size.width) {
[tmpString deleteCharactersInRange:NSMakeRange([tmpString length] - 2, 1)];
}
[tmpString drawInRect:textRect withAttributes:attributes];
[tmpString release];


Can't help you for drawing partial characters, else than to extent your textRect by one character width, then overdraw it partially with background color.


Hope that helps,
Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/


  • Follow-Ups:
    • Re: NSString drawInRect clipping control
      • From: "Mark's Studio" <email@hidden>
References: 
 >Re: NSString drawInRect clipping control (From: "Mark's Studio" <email@hidden>)

  • Prev by Date: Re: NSButton sensing mouse over?
  • Next by Date: RE: app preferences top view
  • Previous by thread: Re: NSString drawInRect clipping control
  • Next by thread: Re: NSString drawInRect clipping control
  • Index(es):
    • Date
    • Thread