• 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: NSCell, Matrix, coordinate system
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCell, Matrix, coordinate system


  • Subject: Re: NSCell, Matrix, coordinate system
  • From: Brian Webster <email@hidden>
  • Date: Wed, 29 May 2002 08:49:03 -0500

On Tuesday, May 28, 2002, at 05:40 PM, cocoa-dev-
email@hidden wrote:

I have found that by simply adding the cellFrame.size.height to the
point's y value, the image composite to the right place. For example,

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
...
my_point = cellFrame.origin;
my_point.y += cellFrame.size.height;
[p_image compositeToPoint: my_point operation:
NSCompositeSourceOver];
...
}

But this seems like such a hack. Is there a more appropriate way to get
my image to composite correctly into my NSMatrix subclass (with its
flipped coordinate system)?

Try using NSImage's drawToPoint: method instead of compositeToPoint:. drawToPoint: respects all coordinate transformations when drawing, but compositeToPoint: does not.

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Button colours
  • Next by Date: Re: applescript: recordability
  • Previous by thread: NSCell, Matrix, coordinate system
  • Next by thread: An alert sheet on a just-opened document
  • Index(es):
    • Date
    • Thread