summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_widgetmgr.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-21 14:27:59 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-21 20:44:29 +0000
commitb45ea1fce52d93615470bab8b671cba5907fb01e (patch)
tree15153c437a253f73b3f5bb154a294ace77fe2c6d /xfa/fwl/cfwl_widgetmgr.cpp
parent37a35df8c878d6e21a62ce0dfd2d480997d9e86c (diff)
downloadpdfium-b45ea1fce52d93615470bab8b671cba5907fb01e.tar.xz
Convert CFWL messages to use CFX_PointF
This Cl updates the various CFWL_Message classes to take CFX_PointF instead of x,y values. Change-Id: I5d9d01d68be64fc9e69c04574994c01286ad24e1 Reviewed-on: https://pdfium-review.googlesource.com/2811 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_widgetmgr.cpp')
-rw-r--r--xfa/fwl/cfwl_widgetmgr.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp
index ea4cbde230..7c0fddd419 100644
--- a/xfa/fwl/cfwl_widgetmgr.cpp
+++ b/xfa/fwl/cfwl_widgetmgr.cpp
@@ -258,8 +258,7 @@ void CFWL_WidgetMgr::SetParent(CFWL_Widget* pParent, CFWL_Widget* pChild) {
}
CFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(CFWL_Widget* parent,
- FX_FLOAT x,
- FX_FLOAT y) {
+ const CFX_PointF& point) const {
if (!parent)
return nullptr;
@@ -272,12 +271,12 @@ CFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(CFWL_Widget* parent,
CFX_Matrix matrixOnParent;
m.SetReverse(matrixOnParent);
- pos = m.Transform(CFX_PointF(x, y));
+ pos = m.Transform(point);
CFX_RectF bounds = child->GetWidgetRect();
- if (bounds.Contains(pos.x, pos.y)) {
+ if (bounds.Contains(pos)) {
pos -= bounds.TopLeft();
- return GetWidgetAtPoint(child, pos.x, pos.y);
+ return GetWidgetAtPoint(child, pos);
}
}
child = GetPriorSiblingWidget(child);
@@ -531,8 +530,7 @@ bool CFWL_WidgetMgr::IsNeedRepaint(CFWL_Widget* pWidget,
CFX_RectF rtChilds;
bool bChildIntersectWithDirty = false;
bool bOrginPtIntersectWidthChild = false;
- bool bOrginPtIntersectWidthDirty =
- rtDirty.Contains(rtWidget.left, rtWidget.top);
+ bool bOrginPtIntersectWidthDirty = rtDirty.Contains(rtWidget.TopLeft());
static FWL_NEEDREPAINTHITDATA hitPoint[kNeedRepaintHitPoints];
FXSYS_memset(hitPoint, 0, sizeof(hitPoint));
FX_FLOAT fxPiece = rtWidget.width / kNeedRepaintHitPiece;
@@ -562,7 +560,7 @@ bool CFWL_WidgetMgr::IsNeedRepaint(CFWL_Widget* pWidget,
if (!bChildIntersectWithDirty && r.IntersectWith(rtDirty))
bChildIntersectWithDirty = true;
if (bOrginPtIntersectWidthDirty && !bOrginPtIntersectWidthChild)
- bOrginPtIntersectWidthChild = rect.Contains(0, 0);
+ bOrginPtIntersectWidthChild = rect.Contains(CFX_PointF(0, 0));
if (rtChilds.IsEmpty())
rtChilds = rect;