# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1325606340 0 # Node ID 9bab702bd6c12fe2f3ac0f7f4424f0b04370a455 # Parent ff78ae1d74291fb568ac0324c2d9703bea592e50 A bunch of Mac drawing updates to correct issues and improve performance. Switched to using a different (faster) method for drawing rectangles. Fixed subpixel drawing issues related to the fact that drawing occurs centered on the coordinate so adding 0.5 draws at a pixel itself instead of spanning two pixels. And related to that removing the incorrect workaround I had previously used of setting the line width to 0.5. Also added DW_DRAW_NOAA support when drawing to windows. diff -r ff78ae1d7429 -r 9bab702bd6c1 mac/dw.m --- a/mac/dw.m Mon Jan 02 06:25:36 2012 +0000 +++ b/mac/dw.m Tue Jan 03 15:59:00 2012 +0000 @@ -5132,12 +5132,11 @@ _DWLastDrawable = handle; } NSBezierPath* aPath = [NSBezierPath bezierPath]; - [aPath setLineWidth: 0.5]; NSColor *color = pthread_getspecific(_dw_fg_color_key); [color set]; - [aPath moveToPoint:NSMakePoint(x1, y1)]; - [aPath lineToPoint:NSMakePoint(x2, y2)]; + [aPath moveToPoint:NSMakePoint(x1 + 0.5, y1 + 0.5)]; + [aPath lineToPoint:NSMakePoint(x2 + 0.5, y2 + 0.5)]; [aPath stroke]; if(pixmap) @@ -5309,17 +5308,17 @@ DW_MUTEX_UNLOCK; return; } + [[NSGraphicsContext currentContext] setShouldAntialias:(flags & DW_DRAW_NOAA ? NO : YES)]; _DWLastDrawable = handle; } NSBezierPath* aPath = [NSBezierPath bezierPath]; - [aPath setLineWidth: 0.5]; NSColor *color = pthread_getspecific(_dw_fg_color_key); [color set]; - [aPath moveToPoint:NSMakePoint(*x, *y)]; + [aPath moveToPoint:NSMakePoint(*x + 0.5, *y + 0.5)]; for(z=1;z