Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1175)

Unified Diff: xfa/fwl/cfwl_widgetmgr.cpp

Issue 2560873005: Cleanup CFWL_Widget code to return CFX_RectFs where appropriate (Closed)
Patch Set: Review feedback Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fwl/cfwl_widgetmgr.h ('k') | xfa/fxfa/app/xfa_fwladapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/cfwl_widgetmgr.cpp
diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp
index 825de0e14e8d2f964fe33c4831d6cc70c4157c8c..f01c02b6b8b85139b95050ff80f4a58d987fda97 100644
--- a/xfa/fwl/cfwl_widgetmgr.cpp
+++ b/xfa/fwl/cfwl_widgetmgr.cpp
@@ -148,18 +148,18 @@ void CFWL_WidgetMgr::AppendWidget(CFWL_Widget* pWidget) {
}
void CFWL_WidgetMgr::RepaintWidget(CFWL_Widget* pWidget,
- const CFX_RectF* pRect) {
+ const CFX_RectF& rect) {
if (!m_pAdapter)
return;
CFWL_Widget* pNative = pWidget;
- CFX_RectF rect(*pRect);
+ CFX_RectF transformedRect = rect;
if (IsFormDisabled()) {
CFWL_Widget* pOuter = pWidget->GetOuter();
while (pOuter) {
CFX_RectF rtTemp = pNative->GetWidgetRect();
- rect.left += rtTemp.left;
- rect.top += rtTemp.top;
+ transformedRect.left += rtTemp.left;
+ transformedRect.top += rtTemp.top;
pNative = pOuter;
pOuter = pOuter->GetOuter();
}
@@ -168,10 +168,10 @@ void CFWL_WidgetMgr::RepaintWidget(CFWL_Widget* pWidget,
if (!pNative)
return;
- pWidget->TransformTo(pNative, rect.left, rect.top);
+ pWidget->TransformTo(pNative, transformedRect.left, transformedRect.top);
}
AddRedrawCounts(pNative);
- m_pAdapter->RepaintWidget(pNative, &rect);
+ m_pAdapter->RepaintWidget(pNative);
}
void CFWL_WidgetMgr::InsertWidget(CFWL_Widget* pParent, CFWL_Widget* pChild) {
@@ -497,11 +497,8 @@ void CFWL_WidgetMgr::OnDrawWidget(CFWL_Widget* pWidget,
}
#endif // _FX_OS_ == _FX_MACOSX_
- if (!IsFormDisabled()) {
- CFX_RectF rtClient;
- pWidget->GetClientRect(rtClient);
- clipBounds.Intersect(rtClient);
- }
+ if (!IsFormDisabled())
+ clipBounds.Intersect(pWidget->GetClientRect());
if (!clipBounds.IsEmpty())
DrawChild(pWidget, clipBounds, pTemp, pMatrix);
« no previous file with comments | « xfa/fwl/cfwl_widgetmgr.h ('k') | xfa/fxfa/app/xfa_fwladapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698