From b6588a43bd66529d8857664a53c3f97d437d01ef Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sat, 24 Dec 2011 18:44:53 +0000 Subject: [PATCH] * Source/cairo/CairoContext.m (-beginPrologueBBox:...): Add a hack to get landscape printing working. Comment in the source reproduced here: FIXME: This is confusing... When an 8.5x11 page is set to landscape, NSPrintInfo also swaps the paperSize to be 11x8.5, but gui also adds a 90 degree rotation as if it will be drawing on a 8.5x11 page. So, swap 11x8.5 back to 8.5x11 here. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@34356 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 10 ++++++++++ Source/cairo/CairoContext.m | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index ffc444a..7181ea7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-12-24 Eric Wasylishen + + * Source/cairo/CairoContext.m (-beginPrologueBBox:...): + Add a hack to get landscape printing working. Comment in the source + reproduced here: + FIXME: This is confusing... When an 8.5x11 page is set to + landscape, NSPrintInfo also swaps the paperSize to be 11x8.5, + but gui also adds a 90 degree rotation as if it will + be drawing on a 8.5x11 page. So, swap 11x8.5 back to 8.5x11 here. + 2011-12-23 Eric Wasylishen * Source/cairo/CairoContext.m (-beginPrologueBBox:...): Use diff --git a/Source/cairo/CairoContext.m b/Source/cairo/CairoContext.m index 756382a..a78446e 100644 --- a/Source/cairo/CairoContext.m +++ b/Source/cairo/CairoContext.m @@ -233,6 +233,17 @@ if (printInfo != nil) { size = [printInfo paperSize]; + + // FIXME: This is confusing.. + // When an 8.5x11 page is set to landscape, + // NSPrintInfo also swaps the paperSize to be 11x8.5, + // but gui also adds a 90 degree rotation as if it will + // be drawing on a 8.5x11 page. So, swap 11x8.5 back to + // 8.5x11 here. + if ([printInfo orientation] == NSLandscapeOrientation) + { + size = NSMakeSize(size.height, size.width); + } } else {