Mercurial > dwindows
diff mac/dw.m @ 954:cfb12bf3bb06
Fixes for some more coordinate system issues on the Mac.
Also some changes to the test program to make sure to test for these type issues.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Mon, 02 May 2011 01:07:49 +0000 |
parents | 2dfc06afc7d3 |
children | beed3e7f9d4b |
line wrap: on
line diff
--- a/mac/dw.m Sun May 01 22:52:38 2011 +0000 +++ b/mac/dw.m Mon May 02 01:07:49 2011 +0000 @@ -275,7 +275,7 @@ button = 3; } - return buttonfunc(object, (int)p.x, (int)[object frame].size.height - p.y, button, handler->data); + return buttonfunc(object, (int)p.x, (int)p.y, button, handler->data); } /* Motion notify event */ case 5: @@ -290,7 +290,7 @@ buttonmask = (1 << [event buttonNumber]); } - return motionfunc(object, (int)p.x, (int)[object frame].size.height - p.y, buttonmask, handler->data); + return motionfunc(object, (int)p.x, (int)p.y, buttonmask, handler->data); } /* Window close event */ case 6: @@ -503,17 +503,6 @@ image = [[NSImage alloc] initWithSize:[rep size]]; [image addRepresentation:rep]; } - // make a new transform: - NSAffineTransform *t = [NSAffineTransform transform]; - - // by scaling Y negatively, we effectively flip the image: - [t scaleXBy:1.0 yBy:-1.0]; - - // but we also have to translate it back by its height: - [t translateXBy:0.0 yBy:-[rep size].height]; - - // apply the transform: - [t concat]; [image drawAtPoint:NSMakePoint(bltinfo->xdest, bltinfo->ydest) fromRect:NSMakeRect(bltinfo->xsrc, bltinfo->ysrc, bltinfo->width, bltinfo->height) operation:NSCompositeSourceOver fraction:1.0]; [bltsrc release]; @@ -734,7 +723,7 @@ -(void)mouseDragged:(NSEvent *)theEvent { _event_handler(self, theEvent, 5); } -(void)drawRect:(NSRect)rect { _event_handler(self, nil, 7); } -(void)keyDown:(NSEvent *)theEvent { _event_handler(self, theEvent, 2); } --(BOOL)isFlipped { return NO; } +-(BOOL)isFlipped { return YES; } -(void)dealloc { UserData *root = userdata; _remove_userdata(&root, NULL, TRUE); [font release]; [super dealloc]; } -(BOOL)acceptsFirstResponder { return YES; } @end