# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1316461703 0 # Node ID 408ea33b19cf53a67088805d15e322dbd463cb08 # Parent eb4589ddff3ebfff46b10b4f2d837005b24c3a01 Ok fixed a problem with the last commit using the wrong representation on Mac. This shows that the problem was in fact the flipped image but the image view still seems to be printing oddly... but at least the important stuff is there now. diff -r eb4589ddff3e -r 408ea33b19cf mac/dw.m --- a/mac/dw.m Mon Sep 19 19:37:35 2011 +0000 +++ b/mac/dw.m Mon Sep 19 19:48:23 2011 +0000 @@ -9406,6 +9406,12 @@ /* Figure out the printer/paper size */ pi = p->pi; size = [pi paperSize]; + /* Okay the size reported is really small... and everything + * in Cocoa is scaled so ... multiply by 2 to get a better + * resolution but maintain the right aspect ratio. + */ + size.width *= 2; + size.height *= 2; /* Create an image view to print and a pixmap to draw into */ iv = [[NSImageView alloc] init]; pixmap = dw_pixmap_new(iv, (int)size.width, (int)size.height, 8); @@ -9419,7 +9425,7 @@ image = [[NSImage alloc] initWithSize:[rep size]]; flipped = [[NSImage alloc] initWithSize:[rep size]]; [image addRepresentation:rep]; - [flipped addRepresentation:pixmap->image]; + [flipped addRepresentation:rep2]; [iv setImage:flipped]; [iv setImageScaling:NSScaleProportionally]; [iv setFrameOrigin:NSMakePoint(0,0)]; @@ -9449,9 +9455,11 @@ p->drawfunc(print, pixmap, x, p->drawdata); /* Internal representation is flipped... so flip again so we can print */ _flip_image(image, rep2, size); +#ifdef DEBUG_PRINT /* Save it to file to see what we have */ NSData *data = [rep2 representationUsingType: NSPNGFileType properties: nil]; [data writeToFile: @"print.png" atomically: NO]; +#endif /* Print the image view */ [po runOperation]; /* Fill the pixmap with white in case we are printing more pages */