diff options
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; |