Author: gcasa
Date: Sun Jul 17 00:18:43 2016
New Revision: 40002

URL: http://svn.gna.org/viewcvs/gnustep?rev=40002&view=rev
Log:
2016-07-16 18:12-EDT Gregory John Casamento <[email protected]>

        * Source/NSPrintInfo.m: Add a comment so it's clear what
        this method is meant for.
        * Source/NSView.m: In beginPage:label:bBox:fonts: align top level
        view with current page dimensions.

Modified:
    libs/gui/trunk/ChangeLog
    libs/gui/trunk/Source/NSPrintInfo.m
    libs/gui/trunk/Source/NSView.m

Modified: libs/gui/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/ChangeLog?rev=40002&r1=40001&r2=40002&view=diff
==============================================================================
--- libs/gui/trunk/ChangeLog    (original)
+++ libs/gui/trunk/ChangeLog    Sun Jul 17 00:18:43 2016
@@ -1,3 +1,10 @@
+2016-07-16 18:12-EDT Gregory John Casamento <[email protected]>
+
+       * Source/NSPrintInfo.m: Add a comment so it's clear what
+       this method is meant for.
+       * Source/NSView.m: In beginPage:label:bBox:fonts: align top level
+       view with current page dimensions.
+
 2016-07-13 Riccardo Mottola <[email protected]>
 
        * Source/NSWorkspace.m

Modified: libs/gui/trunk/Source/NSPrintInfo.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSPrintInfo.m?rev=40002&r1=40001&r2=40002&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSPrintInfo.m (original)
+++ libs/gui/trunk/Source/NSPrintInfo.m Sun Jul 17 00:18:43 2016
@@ -155,8 +155,8 @@
   [self setVerticalPagination: NSAutoPagination];
   [self setHorizontalPagination: NSClipPagination];
   [self setJobDisposition: NSPrintSpoolJob];
-  [self setHorizontallyCentered: YES];
-  [self setVerticallyCentered: YES];
+  [self setHorizontallyCentered: NO];
+  [self setVerticallyCentered: NO];
 
   printer = [NSPrintInfo defaultPrinter];
   [self setPrinter: printer];

Modified: libs/gui/trunk/Source/NSView.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/gui/trunk/Source/NSView.m?rev=40002&r1=40001&r2=40002&view=diff
==============================================================================
--- libs/gui/trunk/Source/NSView.m      (original)
+++ libs/gui/trunk/Source/NSView.m      Sun Jul 17 00:18:43 2016
@@ -4235,12 +4235,26 @@
              fonts: (NSString*)fontNames
 {
   NSPrintOperation *printOp = [NSPrintOperation currentOperation];
+  NSPrintInfo *info = [printOp printInfo];
   NSGraphicsContext *ctxt = [printOp context];
+  NSSize paperSize = [info paperSize];
+  float scale = (double)([self frame].size.width/paperSize.width);
+  float xoff = 0;
+  float yoff = ((paperSize.height - self.frame.size.height) - 10) / scale;
 
   [ctxt  beginPage: ordinalNum
          label: aString
          bBox: pageRect
          fonts: fontNames];
+  
+  // Need to align the view being printed based on the size of the page.
+
+  // Add to scale the page down
+  DPSscale(ctxt, scale, scale);
+  
+  // Add translation
+  DPStranslate(ctxt, xoff, yoff);
+
 }
 
 - (void) beginPageSetupRect: (NSRect)aRect placement: (NSPoint)location
@@ -4270,6 +4284,7 @@
 
 - (void) addToPageSetup
 {
+  // Override this method when you want to add something to the view specific 
to printing.
 }
 
 - (void) beginSetup


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to