FROM : Uli Kusterer
DATE : Sun May 18 00:16:38 2008
> On May 17, 2008, at 12:37 AM, Mike wrote:
>
>> It's a local NSRect which I assume is interchangeable with CGRect
>> as they are the same.
>>
>> I fill in the rect at the top of the method with the Rect of the
>> item in the window from IB and then I hide the item before drawing
>> to prevent my stuff from being drawn over.
>>
>> CGContextFillRect doesn't do anything either. Just a blank space as
>> with PlotIconRefInContext.
Can't find the start of this thread, so this may have already been
covered, but:
Have you checked whether the coordinate system of the port is
flipped? You can flip the Y axis of a context, and then drawings
relative to the lower left edge of the context will actually be drawn
relative to the upper left, and can end up offscreen depending on what
drawing call you're using (some drawing calls aren't intended for
flipped rects, and always draw upwards or downwards from a point
instead of flipping the rect correctly, which is why you have e.g.
CGContextDrawImage() and HIViewDrawCGImage()).
There's also some cases where CG and Cocoa may disagree on whether a
context is flipped or not, or someone applied an affine transform to a
port that causes your drawing to end up off screen.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
DATE : Sun May 18 00:16:38 2008
> On May 17, 2008, at 12:37 AM, Mike wrote:
>
>> It's a local NSRect which I assume is interchangeable with CGRect
>> as they are the same.
>>
>> I fill in the rect at the top of the method with the Rect of the
>> item in the window from IB and then I hide the item before drawing
>> to prevent my stuff from being drawn over.
>>
>> CGContextFillRect doesn't do anything either. Just a blank space as
>> with PlotIconRefInContext.
Can't find the start of this thread, so this may have already been
covered, but:
Have you checked whether the coordinate system of the port is
flipped? You can flip the Y axis of a context, and then drawings
relative to the lower left edge of the context will actually be drawn
relative to the upper left, and can end up offscreen depending on what
drawing call you're using (some drawing calls aren't intended for
flipped rects, and always draw upwards or downwards from a point
instead of flipping the rect correctly, which is why you have e.g.
CGContextDrawImage() and HIViewDrawCGImage()).
There's also some cases where CG and Cocoa may disagree on whether a
context is flipped or not, or someone applied an affine transform to a
port that causes your drawing to end up off screen.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
| Related mails | Author | Date |
|---|---|---|
| Michael Vannorsdel | May 17, 17:06 | |
| Michael Babin | May 17, 17:29 | |
| Mike | May 17, 22:16 | |
| Mike | May 17, 23:15 | |
| Adam R. Maxwell | May 17, 23:31 | |
| Mike | May 17, 23:37 | |
| Uli Kusterer | May 18, 00:16 | |
| Michael Vannorsdel | May 18, 00:46 |






Cocoa mail archive

