aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFPageObjectHelper.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-02-21 13:51:17 +0100
committerJay Berkenbilt <ejb@ql.org>2021-02-21 20:58:45 +0100
commite899926e0d0e8ccafdc2660b247ac127e2a97164 (patch)
treeff641161c2e95c70bc1d1bd63b84acf48c66ebe9 /libqpdf/QPDFPageObjectHelper.cc
parentaa848126cb6ceb00bd93e71d0ce53d93ee824897 (diff)
downloadqpdf-e899926e0d0e8ccafdc2660b247ac127e2a97164.tar.zst
Use QPDFMatrix inside flattenRotations
Diffstat (limited to 'libqpdf/QPDFPageObjectHelper.cc')
-rw-r--r--libqpdf/QPDFPageObjectHelper.cc12
1 files changed, 2 insertions, 10 deletions
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(