Rotate page contents in landscape mode.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31404 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Pfeiffer 2009-07-04 07:19:51 +00:00
parent 35c255e59d
commit a269184003

View File

@ -70,9 +70,17 @@ bool PSDriver::endPage(int)
void PSDriver::setupCTM() {
const float leftMargin = getJobData()->getPrintableRect().left;
const float topMargin = getJobData()->getPrintableRect().top;
if (getJobData()->getOrientation() == JobData::kPortrait) {
// move origin from bottom left to top left
// and set margin
writeSpoolString("%f %f translate\n", leftMargin, getJobData()->getPaperRect().Height()-topMargin);
} else {
// landscape:
// move origin from bottom left to margin top and left
// and rotate page contents
writeSpoolString("%f %f translate\n", topMargin, leftMargin);
writeSpoolString("90 rotate\n");
}
// y values increase from top to bottom
// units of measure is dpi
writeSpoolString("72 %d div 72 -%d div scale\n", getJobData()->getXres(), getJobData()->getYres());