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 --- xfa/fwl/cfwl_widget.cpp | 5 ++--- xfa/fwl/cfwl_widgetmgr.cpp | 7 +------ 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'xfa/fwl') diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp index 172014da62..45ae9c0b0c 100644 --- a/xfa/fwl/cfwl_widget.cpp +++ b/xfa/fwl/cfwl_widget.cpp @@ -197,9 +197,8 @@ CFX_PointF CFWL_Widget::TransformTo(CFWL_Widget* pWidget, if (!parent) return ret; - CFX_Matrix m; - m.SetReverse(pWidget->GetMatrix()); - return m.Transform(ret) - pWidget->GetWidgetRect().TopLeft(); + return pWidget->GetMatrix().GetInverse().Transform(ret) - + pWidget->GetWidgetRect().TopLeft(); } CFX_Matrix CFWL_Widget::GetMatrix() { diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp index 67a63ba921..3abe14d89b 100644 --- a/xfa/fwl/cfwl_widgetmgr.cpp +++ b/xfa/fwl/cfwl_widgetmgr.cpp @@ -266,12 +266,7 @@ CFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(CFWL_Widget* parent, CFWL_Widget* child = GetLastChildWidget(parent); while (child) { if ((child->GetStates() & FWL_WGTSTATE_Invisible) == 0) { - CFX_Matrix m; - m.SetIdentity(); - - CFX_Matrix matrixOnParent; - m.SetReverse(matrixOnParent); - pos = m.Transform(point); + pos = parent->GetMatrix().GetInverse().Transform(point); CFX_RectF bounds = child->GetWidgetRect(); if (bounds.Contains(pos)) { -- cgit v1.2.3