Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #include "xfa/fwl/cfwl_widgetmgr.h" | 7 #include "xfa/fwl/cfwl_widgetmgr.h" |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 return nullptr; | 291 return nullptr; |
| 292 | 292 |
| 293 FX_FLOAT x1; | 293 FX_FLOAT x1; |
| 294 FX_FLOAT y1; | 294 FX_FLOAT y1; |
| 295 CFWL_Widget* child = GetLastChildWidget(parent); | 295 CFWL_Widget* child = GetLastChildWidget(parent); |
| 296 while (child) { | 296 while (child) { |
| 297 if ((child->GetStates() & FWL_WGTSTATE_Invisible) == 0) { | 297 if ((child->GetStates() & FWL_WGTSTATE_Invisible) == 0) { |
| 298 x1 = x; | 298 x1 = x; |
| 299 y1 = y; | 299 y1 = y; |
| 300 CFX_Matrix matrixOnParent; | 300 CFX_Matrix matrixOnParent; |
| 301 child->GetMatrix(matrixOnParent, false); | |
|
dsinclair
2016/12/08 19:02:46
This would, at most, SetIdentity on the matrix, bu
| |
| 302 CFX_Matrix m; | 301 CFX_Matrix m; |
| 303 m.SetIdentity(); | 302 m.SetIdentity(); |
| 304 m.SetReverse(matrixOnParent); | 303 m.SetReverse(matrixOnParent); |
| 305 m.TransformPoint(x1, y1); | 304 m.TransformPoint(x1, y1); |
| 306 CFX_RectF bounds = child->GetWidgetRect(); | 305 CFX_RectF bounds = child->GetWidgetRect(); |
| 307 if (bounds.Contains(x1, y1)) { | 306 if (bounds.Contains(x1, y1)) { |
| 308 x1 -= bounds.left; | 307 x1 -= bounds.left; |
| 309 y1 -= bounds.top; | 308 y1 -= bounds.top; |
| 310 return GetWidgetAtPoint(child, x1, y1); | 309 return GetWidgetAtPoint(child, x1, y1); |
| 311 } | 310 } |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 521 if (child->GetStates() & FWL_WGTSTATE_Invisible) | 520 if (child->GetStates() & FWL_WGTSTATE_Invisible) |
| 522 continue; | 521 continue; |
| 523 | 522 |
| 524 CFX_RectF rtWidget = child->GetWidgetRect(); | 523 CFX_RectF rtWidget = child->GetWidgetRect(); |
| 525 if (rtWidget.IsEmpty()) | 524 if (rtWidget.IsEmpty()) |
| 526 continue; | 525 continue; |
| 527 | 526 |
| 528 CFX_Matrix widgetMatrix; | 527 CFX_Matrix widgetMatrix; |
| 529 CFX_RectF clipBounds(rtWidget); | 528 CFX_RectF clipBounds(rtWidget); |
| 530 if (!bFormDisable) | 529 if (!bFormDisable) |
| 531 child->GetMatrix(widgetMatrix, true); | 530 widgetMatrix = child->GetMatrix(); |
| 532 if (pMatrix) | 531 if (pMatrix) |
| 533 widgetMatrix.Concat(*pMatrix); | 532 widgetMatrix.Concat(*pMatrix); |
| 534 | 533 |
| 535 if (!bFormDisable) { | 534 if (!bFormDisable) { |
| 536 widgetMatrix.TransformPoint(clipBounds.left, clipBounds.top); | 535 widgetMatrix.TransformPoint(clipBounds.left, clipBounds.top); |
| 537 clipBounds.Intersect(rtClip); | 536 clipBounds.Intersect(rtClip); |
| 538 if (clipBounds.IsEmpty()) | 537 if (clipBounds.IsEmpty()) |
| 539 continue; | 538 continue; |
| 540 | 539 |
| 541 pGraphics->SaveGraphState(); | 540 pGraphics->SaveGraphState(); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 720 pWidget(widget), | 719 pWidget(widget), |
| 721 iRedrawCounter(0) | 720 iRedrawCounter(0) |
| 722 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 721 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
| 723 , | 722 , |
| 724 bOutsideChanged(false) | 723 bOutsideChanged(false) |
| 725 #endif | 724 #endif |
| 726 { | 725 { |
| 727 } | 726 } |
| 728 | 727 |
| 729 CFWL_WidgetMgr::Item::~Item() {} | 728 CFWL_WidgetMgr::Item::~Item() {} |
| OLD | NEW |