• 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: How to draw correct underline ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to draw correct underline ?


  • Subject: Re: How to draw correct underline ?
  • From: Keith Blount <email@hidden>
  • Date: Thu, 25 Aug 2005 15:41:31 -0700 (PDT)

Usually, when a line is drawn across two pixels when
you expect it to be drawn across only one, it is
because of where you have placed it. If you want to
draw a one pixel line, it has to be placed at the
centre of a pixel. So, for instance, if you were to
draw a line at the Y position 10.0, it would be
blurred, but if you drew it at Y position 10.5, it
would be drawn "correctly".

Thus, in your original post, where you had this:

[[self title] drawInRect:textRect
withAttributes:stringAttributes];

Try:
textRect.origin.y = roundf(textRect.origin.y)+0.5;
[[self title] drawInRect:textRect
withAttributes:stringAttributes];


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to draw correct underline ?
      • From: Eric Morand <email@hidden>
  • Prev by Date: Re: Finding all subclasses of a class ?
  • Next by Date: Re: How to draw correct underline ?
  • Previous by thread: Re: [Moderator] Re-posts (Re: How to draw correct underline ?)
  • Next by thread: Re: How to draw correct underline ?
  • Index(es):
    • Date
    • Thread