aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFMatrix.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-02-18 17:27:25 +0100
committerJay Berkenbilt <ejb@ql.org>2021-02-20 00:35:19 +0100
commit71e86272859aa2794263cc59446a20a826d6d3aa (patch)
tree59a077b5cd05be0c4c75ac12181afd6645dad98f /libqpdf/QPDFMatrix.cc
parentde8929a41ce093a0c21ca48b2342a73cf67a51f0 (diff)
downloadqpdf-71e86272859aa2794263cc59446a20a826d6d3aa.tar.zst
Add const versions of QPDFMatrix::transform*
Diffstat (limited to 'libqpdf/QPDFMatrix.cc')
-rw-r--r--libqpdf/QPDFMatrix.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/libqpdf/QPDFMatrix.cc b/libqpdf/QPDFMatrix.cc
index 18122d72..2b269099 100644
--- a/libqpdf/QPDFMatrix.cc
+++ b/libqpdf/QPDFMatrix.cc
@@ -111,6 +111,12 @@ QPDFMatrix::rotatex90(int angle)
void
QPDFMatrix::transform(double x, double y, double& xp, double& yp)
{
+ const_cast<QPDFMatrix const*>(this)->transform(x, y, xp, yp);
+}
+
+void
+QPDFMatrix::transform(double x, double y, double& xp, double& yp) const
+{
xp = (this->a * x) + (this->c * y) + this->e;
yp = (this->b * x) + (this->d * y) + this->f;
}
@@ -118,6 +124,12 @@ QPDFMatrix::transform(double x, double y, double& xp, double& yp)
QPDFObjectHandle::Rectangle
QPDFMatrix::transformRectangle(QPDFObjectHandle::Rectangle r)
{
+ return const_cast<QPDFMatrix const*>(this)->transformRectangle(r);
+}
+
+QPDFObjectHandle::Rectangle
+QPDFMatrix::transformRectangle(QPDFObjectHandle::Rectangle r) const
+{
std::vector<double> tx(4);
std::vector<double> ty(4);
transform(r.llx, r.lly, tx.at(0), ty.at(0));