diff --git a/ChangeLog b/ChangeLog index 7744c223d..2bc8f98b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2016-07-18 11:59-EDT Gregory John Casamento + + * Source/NSView.m: Move to new branch. + 2016-07-18 11:46-EDT Gregory John Casamento * Source/NSView.m: Revert previous changes. Moving to a branch. diff --git a/Source/NSView.m b/Source/NSView.m index 8f0a9afd2..bd2519529 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -4235,12 +4235,26 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level) 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 @@ static NSView* findByTag(NSView *view, NSInteger aTag, NSUInteger *level) - (void) addToPageSetup { + // Override this method when you want to add something to the view specific to printing. } - (void) beginSetup