• 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: Problem with drawBackgroundForGlyphRange:atPoint:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Problem with drawBackgroundForGlyphRange:atPoint:
      • From: "Jjgod Jiang" <email@hidden>
References: 
 >Problem with drawBackgroundForGlyphRange:atPoint: (From: "Jjgod Jiang" <email@hidden>)

  • Prev by Date: Re: CGImageRef to bitmap context? [SOLVED]
  • Next by Date: Re: Cocoa and PICT
  • Previous by thread: Problem with drawBackgroundForGlyphRange:atPoint:
  • Next by thread: Re: Problem with drawBackgroundForGlyphRange:atPoint:
  • Index(es):
    • Date
    • Thread