2016-07-16 18:12-EDT Gregory John Casamento <greg.casamento@gmail.com>

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


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@40002 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2016-07-16 22:18:43 +00:00
parent 4d9feda044
commit dd398ac140
3 changed files with 24 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2016-07-16 18:12-EDT Gregory John Casamento <greg.casamento@gmail.com>
* 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 <rm@gnu.org>
* Source/NSWorkspace.m

View file

@ -155,8 +155,8 @@ static NSPrintInfo *sharedPrintInfo = nil;
[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];

View file

@ -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];
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 @@ 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