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 {