• 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
sizeWithAttributes Cutting Off Drop Shadow, Italic Mask?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sizeWithAttributes Cutting Off Drop Shadow, Italic Mask?


  • Subject: sizeWithAttributes Cutting Off Drop Shadow, Italic Mask?
  • From: Chunk 1978 <email@hidden>
  • Date: Fri, 30 Oct 2009 11:10:18 -0400

does sizeWithAttributes not take into account the offset of an NSDropShadow
or italic font mask?  i have a dictionary of attributes for a string, and
i'm trying to produce an image for the drag that doesn't crop the image with
these attributes.

NSSize stringSize = [string sizeWithAttributes:attributes];

NSImage *anImage = [[NSImage alloc] initWithSize:stringSize];

 NSRect imageBounds;

imageBounds.origin = NSZeroPoint;

imageBounds.size = stringSize;

 [anImage lockFocus];

[self drawStringCenteredIn:imageBounds];

[anImage unlockFocus];

Attachment: drag.jpg
Description: JPEG image

_______________________________________________

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: sizeWithAttributes Cutting Off Drop Shadow, Italic Mask?
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Programmatically add a UISearchBar
  • Next by Date: Re: sizeWithAttributes Cutting Off Drop Shadow, Italic Mask?
  • Previous by thread: Programmatically add a UISearchBar
  • Next by thread: Re: sizeWithAttributes Cutting Off Drop Shadow, Italic Mask?
  • Index(es):
    • Date
    • Thread