From e899926e0d0e8ccafdc2660b247ac127e2a97164 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 21 Feb 2021 07:51:17 -0500 Subject: Use QPDFMatrix inside flattenRotations --- libqpdf/QPDFPageObjectHelper.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'libqpdf/QPDFPageObjectHelper.cc') diff --git a/libqpdf/QPDFPageObjectHelper.cc b/libqpdf/QPDFPageObjectHelper.cc index e744457b..b7f96dc0 100644 --- a/libqpdf/QPDFPageObjectHelper.cc +++ b/libqpdf/QPDFPageObjectHelper.cc @@ -1168,9 +1168,7 @@ QPDFPageObjectHelper::flattenRotation() // the same offset from the lower left corner of the media box. // These calculations have been verified empirically with various // PDF readers. - QPDFObjectHandle::Matrix cm; - cm.e = 0.0; - cm.f = 0.0; + QPDFMatrix cm(0, 0, 0, 0, 0, 0); switch (rotate) { case 90: @@ -1196,13 +1194,7 @@ QPDFPageObjectHelper::flattenRotation() break; } std::string cm_str = - std::string("q\n") + - QUtil::double_to_string(cm.a, 2) + " " + - QUtil::double_to_string(cm.b, 2) + " " + - QUtil::double_to_string(cm.c, 2) + " " + - QUtil::double_to_string(cm.d, 2) + " " + - QUtil::double_to_string(cm.e, 2) + " " + - QUtil::double_to_string(cm.f, 2) + " cm\n"; + std::string("q\n") + cm.unparse() + " cm\n"; this->oh.addPageContents( QPDFObjectHandle::newStream(qpdf, cm_str), true); this->oh.addPageContents( -- cgit v1.2.3-54-g00ecf