NSView Drawing & IsFlipped with overlayed image

95 views Asked by At

I've drawn onto an NSView which displays fine except for the fact it was flipped. I've set isFlipped to YES so it displays the correct way round.

I then overlay an image using drawInRect and [super drawRect:dirtyRect];

The problem is the overlayed image is now flipped incorrectly. How can I flip the main drawing but leave the overlayed image unflipped?

1

There are 1 answers

1
NSGod On

You might try using NSImage's drawInRect:fromRect:operation:fraction:respectFlipped:hints: method rather than drawInRect::

[image drawInRect:rect
         fromRect:NSZeroRect
        operation:NSCompositeSourceOver
         fraction:1.0
   respectFlipped:NO
            hints:nil];

Passing NO for respectFlipped: may give you what you're looking for.