From b21f174ad87e46c823c2ef8c11682167e2d12864 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Thu, 29 Jun 2017 12:02:06 -0400 Subject: Change SetReverse to GetInverse in CFX_Matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CFX_Matrix::GetInverse is much clearer. Change-Id: Id10ab1723735332e1a78de853f28415ec3a4d834 Reviewed-on: https://pdfium-review.googlesource.com/7090 Reviewed-by: Lei Zhang Commit-Queue: Nicolás Peña --- fpdfsdk/pdfwindow/cpwl_icon.cpp | 3 +-- fpdfsdk/pdfwindow/cpwl_wnd.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'fpdfsdk/pdfwindow') diff --git a/fpdfsdk/pdfwindow/cpwl_icon.cpp b/fpdfsdk/pdfwindow/cpwl_icon.cpp index 6650311915..ebf3b4fc12 100644 --- a/fpdfsdk/pdfwindow/cpwl_icon.cpp +++ b/fpdfsdk/pdfwindow/cpwl_icon.cpp @@ -23,8 +23,7 @@ CFX_ByteString CPWL_Image::GetImageAppStream() { CFX_ByteString sAlias = GetImageAlias(); CFX_FloatRect rcPlate = GetClientRect(); - CFX_Matrix mt; - mt.SetReverse(GetImageMatrix()); + CFX_Matrix mt = GetImageMatrix().GetInverse(); float fHScale = 1.0f; float fVScale = 1.0f; diff --git a/fpdfsdk/pdfwindow/cpwl_wnd.cpp b/fpdfsdk/pdfwindow/cpwl_wnd.cpp index a8b5c31254..85a610eea5 100644 --- a/fpdfsdk/pdfwindow/cpwl_wnd.cpp +++ b/fpdfsdk/pdfwindow/cpwl_wnd.cpp @@ -765,7 +765,9 @@ CFX_PointF CPWL_Wnd::ParentToChild(const CFX_PointF& point) const { if (mt.IsIdentity()) return point; - mt.SetReverse(mt); + CFX_Matrix inverse = mt.GetInverse(); + if (!inverse.IsIdentity()) + mt = inverse; return mt.Transform(point); } @@ -774,7 +776,9 @@ CFX_FloatRect CPWL_Wnd::ParentToChild(const CFX_FloatRect& rect) const { if (mt.IsIdentity()) return rect; - mt.SetReverse(mt); + CFX_Matrix inverse = mt.GetInverse(); + if (!inverse.IsIdentity()) + mt = inverse; CFX_FloatRect rc = rect; mt.TransformRect(rc); return rc; -- cgit v1.2.3