Re: NSCell, Matrix, coordinate system
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.