Re: NSString drawInRect clipping control
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/