Re: Problem with drawBackgroundForGlyphRange:atPoint:
Re: Problem with drawBackgroundForGlyphRange:atPoint:
- Subject: Re: Problem with drawBackgroundForGlyphRange:atPoint:
- From: "Lukhnos D. Liu" <email@hidden>
- Date: Tue, 14 Aug 2007 02:37:11 +0800
On 8/13/07, Jjgod Jiang <email@hidden> wrote:
> When I was trying to do custom text drawing with NSLayoutManager,
> I got the following problem:
> - (void) drawRect:(NSRect)rect
> {
// ...
> [layoutManager drawBackgroundForGlyphRange: glyphRange atPoint:
> NSMakePoint(0, 0)];
> [layoutManager drawGlyphsForGlyphRange: glyphRange atPoint:
> NSMakePoint(0, 0)];
> Foreground text is drawn correctly, but background is never drawn
> no matter which color I set for NSBackgroundColorAttributeName.
Before you draw the background, try:
NSRange anotherRange;
anotherRange = [layoutManager glyphRangeForTextContainer:textContainer];
d.
_______________________________________________
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