diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-05 22:18:32 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-05 22:18:32 +0000 |
commit | a0032a2a2c53794bbf0ccb412a5c70ce66f052fb (patch) | |
tree | 6de942a596e722095d1ac933c7ef4e04254dba8a /core/fpdfapi/page/cpdf_clippath.cpp | |
parent | 90ad6b38f2cf4f32ba705659e0fa5f18274dad62 (diff) | |
download | pdfium-a0032a2a2c53794bbf0ccb412a5c70ce66f052fb.tar.xz |
Remove optional matrix parameter from CPDF_PageObject::GetBBox().
Instead, add GetTransformedBBox() with a required matrix parameter and
use that when the there is a matrix.
Change-Id: I594f3eb6bc7e1bc3eb6aa9f66556ebb1dfdbebe1
Reviewed-on: https://pdfium-review.googlesource.com/c/43553
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_clippath.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_clippath.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/core/fpdfapi/page/cpdf_clippath.cpp b/core/fpdfapi/page/cpdf_clippath.cpp index 465a2d3549..9782469786 100644 --- a/core/fpdfapi/page/cpdf_clippath.cpp +++ b/core/fpdfapi/page/cpdf_clippath.cpp @@ -55,21 +55,21 @@ CFX_FloatRect CPDF_ClipPath::GetClipBox() const { bool bLayerStarted = false; for (size_t i = 0; i < GetTextCount(); ++i) { CPDF_TextObject* pTextObj = GetText(i); - if (!pTextObj) { - if (!bStarted) { - rect = layer_rect; - bStarted = true; + if (pTextObj) { + if (bLayerStarted) { + layer_rect.Union(CFX_FloatRect(pTextObj->GetBBox())); } else { - rect.Intersect(layer_rect); + layer_rect = CFX_FloatRect(pTextObj->GetBBox()); + bLayerStarted = true; } - bLayerStarted = false; } else { - if (!bLayerStarted) { - layer_rect = CFX_FloatRect(pTextObj->GetBBox(nullptr)); - bLayerStarted = true; + if (bStarted) { + rect.Intersect(layer_rect); } else { - layer_rect.Union(CFX_FloatRect(pTextObj->GetBBox(nullptr))); + rect = layer_rect; + bStarted = true; } + bLayerStarted = false; } } return rect; |