summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_widgetmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fwl/cfwl_widgetmgr.cpp')
-rw-r--r--xfa/fwl/cfwl_widgetmgr.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp
index cd9c3e609d..6e537a4ad9 100644
--- a/xfa/fwl/cfwl_widgetmgr.cpp
+++ b/xfa/fwl/cfwl_widgetmgr.cpp
@@ -267,9 +267,10 @@ CFWL_Widget* CFWL_WidgetMgr::GetWidgetAtPoint(CFWL_Widget* parent,
if ((child->GetStates() & FWL_WGTSTATE_Invisible) == 0) {
x1 = x;
y1 = y;
- CFX_Matrix matrixOnParent;
CFX_Matrix m;
m.SetIdentity();
+
+ CFX_Matrix matrixOnParent;
m.SetReverse(matrixOnParent);
m.TransformPoint(x1, y1);
CFX_RectF bounds = child->GetWidgetRect();
@@ -428,9 +429,7 @@ void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget,
if (!pWidget || !pGraphics)
return;
- CFX_RectF clipCopy = pWidget->GetWidgetRect();
- clipCopy.left = clipCopy.top = 0;
-
+ CFX_RectF clipCopy(0, 0, pWidget->GetWidgetRect().Size());
CFX_RectF clipBounds;
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ || \
@@ -444,7 +443,7 @@ void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget,
pGraphics->GetClipRect(clipBounds);
clipCopy = clipBounds;
} else {
- clipBounds.Set(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d);
+ clipBounds = CFX_RectF(pMatrix->a, pMatrix->b, pMatrix->c, pMatrix->d);
const_cast<CFX_Matrix*>(pMatrix)->SetIdentity(); // FIXME: const cast.
pWidget->GetDelegate()->OnDrawWidget(pGraphics, pMatrix);
}
@@ -518,8 +517,7 @@ bool CFWL_WidgetMgr::IsNeedRepaint(CFWL_Widget* pWidget,
return true;
}
- CFX_RectF rtWidget = pWidget->GetWidgetRect();
- rtWidget.left = rtWidget.top = 0;
+ CFX_RectF rtWidget(0, 0, pWidget->GetWidgetRect().Size());
pMatrix->TransformRect(rtWidget);
if (!rtWidget.IntersectWith(rtDirty))
return false;
@@ -530,7 +528,6 @@ bool CFWL_WidgetMgr::IsNeedRepaint(CFWL_Widget* pWidget,
return true;
CFX_RectF rtChilds;
- rtChilds.Empty();
bool bChildIntersectWithDirty = false;
bool bOrginPtIntersectWidthChild = false;
bool bOrginPtIntersectWidthDirty =
@@ -555,9 +552,8 @@ bool CFWL_WidgetMgr::IsNeedRepaint(CFWL_Widget* pWidget,
rtWidget.height + rtWidget.top;
do {
CFX_RectF rect = pChild->GetWidgetRect();
- CFX_RectF r = rect;
- r.left += rtWidget.left;
- r.top += rtWidget.top;
+ CFX_RectF r(rect.left + rtWidget.left, rect.top + rtWidget.top, rect.width,
+ rect.height);
if (r.IsEmpty())
continue;
if (r.Contains(rtDirty))