Commit e899926e0d0e8ccafdc2660b247ac127e2a97164

Authored by Jay Berkenbilt
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 1168 // the same offset from the lower left corner of the media box.
1169 1169 // These calculations have been verified empirically with various
1170 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 1172 switch (rotate)
1175 1173 {
1176 1174 case 90:
... ... @@ -1196,13 +1194,7 @@ QPDFPageObjectHelper::flattenRotation()
1196 1194 break;
1197 1195 }
1198 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 1198 this->oh.addPageContents(
1207 1199 QPDFObjectHandle::newStream(qpdf, cm_str), true);
1208 1200 this->oh.addPageContents(
... ...