Commit e899926e0d0e8ccafdc2660b247ac127e2a97164
1 parent
aa848126
Use QPDFMatrix inside flattenRotations
Showing
1 changed file
with
2 additions
and
10 deletions
libqpdf/QPDFPageObjectHelper.cc
| @@ -1168,9 +1168,7 @@ QPDFPageObjectHelper::flattenRotation() | @@ -1168,9 +1168,7 @@ QPDFPageObjectHelper::flattenRotation() | ||
| 1168 | // the same offset from the lower left corner of the media box. | 1168 | // the same offset from the lower left corner of the media box. |
| 1169 | // These calculations have been verified empirically with various | 1169 | // These calculations have been verified empirically with various |
| 1170 | // PDF readers. | 1170 | // PDF readers. |
| 1171 | - QPDFObjectHandle::Matrix cm; | ||
| 1172 | - cm.e = 0.0; | ||
| 1173 | - cm.f = 0.0; | 1171 | + QPDFMatrix cm(0, 0, 0, 0, 0, 0); |
| 1174 | switch (rotate) | 1172 | switch (rotate) |
| 1175 | { | 1173 | { |
| 1176 | case 90: | 1174 | case 90: |
| @@ -1196,13 +1194,7 @@ QPDFPageObjectHelper::flattenRotation() | @@ -1196,13 +1194,7 @@ QPDFPageObjectHelper::flattenRotation() | ||
| 1196 | break; | 1194 | break; |
| 1197 | } | 1195 | } |
| 1198 | std::string cm_str = | 1196 | std::string cm_str = |
| 1199 | - std::string("q\n") + | ||
| 1200 | - QUtil::double_to_string(cm.a, 2) + " " + | ||
| 1201 | - QUtil::double_to_string(cm.b, 2) + " " + | ||
| 1202 | - QUtil::double_to_string(cm.c, 2) + " " + | ||
| 1203 | - QUtil::double_to_string(cm.d, 2) + " " + | ||
| 1204 | - QUtil::double_to_string(cm.e, 2) + " " + | ||
| 1205 | - QUtil::double_to_string(cm.f, 2) + " cm\n"; | 1197 | + std::string("q\n") + cm.unparse() + " cm\n"; |
| 1206 | this->oh.addPageContents( | 1198 | this->oh.addPageContents( |
| 1207 | QPDFObjectHandle::newStream(qpdf, cm_str), true); | 1199 | QPDFObjectHandle::newStream(qpdf, cm_str), true); |
| 1208 | this->oh.addPageContents( | 1200 | this->oh.addPageContents( |