Re: Casting NSRect to CGRect?
Re: Casting NSRect to CGRect?
- Subject: Re: Casting NSRect to CGRect?
- From: Pete Carss <email@hidden>
- Date: Fri, 18 Jan 2002 01:09:40 +0000
But I get:
'conversion to a non-scalar type requested'?
Pete
On Friday, January 18, 2002, at 12:39 , John C. Randolph wrote:
On Thursday, January 17, 2002, at 04:22 PM, Pete Carss wrote:
I have a DrawRect method in a custom view - which takes an NSRect - as it
should. I want to use this data in a CG call that expects a CGRect - I delved
into the docs and the structs that define them are the same - is there an
easy way to get from one to the other?
Just cast it. They're the same thing:
NSRect foundationRect;
CGRect coreGraphicsRect = (CGRect) foundationRect;
-jcr
"Only in a police state is the job of a policeman easy." - Orson Welles