Author: gcasa
Date: Tue Jul 19 16:50:51 2016
New Revision: 40018
URL: http://svn.gna.org/viewcvs/gnustep?rev=40018&view=rev
Log:
Move changes to branch
Modified:
libs/gui/branches/printing_fixes/Source/NSView.m
Modified: libs/gui/branches/printing_fixes/Source/NSView.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/gui/branches/printing_fixes/Source/NSView.m?rev=40018&r1=40017&r2=40018&view=diff
==============================================================================
--- libs/gui/branches/printing_fixes/Source/NSView.m (original)
+++ libs/gui/branches/printing_fixes/Source/NSView.m Tue Jul 19 16:50:51 2016
@@ -4235,12 +4235,26 @@
fonts: (NSString*)fontNames
{
NSPrintOperation *printOp = [NSPrintOperation currentOperation];
+ NSPrintInfo *info = [printOp printInfo];
NSGraphicsContext *ctxt = [printOp context];
+ NSSize paperSize = [info paperSize];
+ CGFloat scale = (double)([self frame].size.width/paperSize.width);
+ CGFloat xoff = 0.0;
+ CGFloat yoff = (paperSize.height - self.frame.size.height) / 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