changeset 1144:5878dbfafbe2

Need to size the NSImageView to print it apparently on Mac. Also release the NSImageView and NSImage so we don't leak.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 11 Sep 2011 02:45:38 +0000
parents b1b23de965d7
children 9c47a0245872
files mac/dw.m
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mac/dw.m	Sat Sep 10 18:34:25 2011 +0000
+++ b/mac/dw.m	Sun Sep 11 02:45:38 2011 +0000
@@ -9357,6 +9357,9 @@
     image = [[NSImage alloc] initWithSize:[rep size]];
     [image addRepresentation:rep];
     [iv setImage:image];
+    [iv setImageScaling:NSScaleProportionally];
+    [iv setFrameOrigin:NSMakePoint(0,0)];
+    [iv setFrameSize:size];
     
     /* Create the print operation using the image view and
      * print info obtained from the panel in the last call.
@@ -9389,8 +9392,10 @@
     if(p->drawfunc)
         result = DW_ERROR_NONE;
     /* Free memory */
+    [image release];
     dw_pixmap_destroy(pixmap);
     free(p);
+    [iv release];
     return result;
 }