summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r--core/fpdfapi/page/cpdf_contentparser.cpp6
-rw-r--r--core/fpdfapi/page/cpdf_formobject.cpp2
-rw-r--r--core/fpdfapi/page/cpdf_imageobject.cpp6
-rw-r--r--core/fpdfapi/page/cpdf_pathobject.cpp3
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.cpp2
5 files changed, 12 insertions, 7 deletions
diff --git a/core/fpdfapi/page/cpdf_contentparser.cpp b/core/fpdfapi/page/cpdf_contentparser.cpp
index 1e0fe62e09..7f00eabb86 100644
--- a/core/fpdfapi/page/cpdf_contentparser.cpp
+++ b/core/fpdfapi/page/cpdf_contentparser.cpp
@@ -90,10 +90,12 @@ void CPDF_ContentParser::Start(CPDF_Form* pForm,
ClipPath.Transform(&form_matrix);
if (pParentMatrix)
ClipPath.Transform(pParentMatrix);
- form_bbox.Transform(&form_matrix);
+
+ form_matrix.TransformRect(form_bbox);
if (pParentMatrix)
- form_bbox.Transform(pParentMatrix);
+ pParentMatrix->TransformRect(form_bbox);
}
+
CPDF_Dictionary* pResources = pForm->m_pFormDict->GetDictFor("Resources");
m_pParser = pdfium::MakeUnique<CPDF_StreamContentParser>(
pForm->m_pDocument, pForm->m_pPageResources, pForm->m_pResources,
diff --git a/core/fpdfapi/page/cpdf_formobject.cpp b/core/fpdfapi/page/cpdf_formobject.cpp
index dc596e53c6..5642a5dd01 100644
--- a/core/fpdfapi/page/cpdf_formobject.cpp
+++ b/core/fpdfapi/page/cpdf_formobject.cpp
@@ -35,7 +35,7 @@ CPDF_PageObject::Type CPDF_FormObject::GetType() const {
void CPDF_FormObject::CalcBoundingBox() {
CFX_FloatRect form_rect = m_pForm->CalcBoundingBox();
- form_rect.Transform(&m_FormMatrix);
+ m_FormMatrix.TransformRect(form_rect);
m_Left = form_rect.left;
m_Bottom = form_rect.bottom;
m_Right = form_rect.right;
diff --git a/core/fpdfapi/page/cpdf_imageobject.cpp b/core/fpdfapi/page/cpdf_imageobject.cpp
index bb91820548..01d2df7421 100644
--- a/core/fpdfapi/page/cpdf_imageobject.cpp
+++ b/core/fpdfapi/page/cpdf_imageobject.cpp
@@ -41,8 +41,10 @@ const CPDF_ImageObject* CPDF_ImageObject::AsImage() const {
}
void CPDF_ImageObject::CalcBoundingBox() {
- m_Left = m_Bottom = 0;
- m_Right = m_Top = 1.0f;
+ m_Left = 0;
+ m_Bottom = 0;
+ m_Right = 1.0f;
+ m_Top = 1.0f;
m_Matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom);
}
diff --git a/core/fpdfapi/page/cpdf_pathobject.cpp b/core/fpdfapi/page/cpdf_pathobject.cpp
index 27c4535fa5..b5bb89390c 100644
--- a/core/fpdfapi/page/cpdf_pathobject.cpp
+++ b/core/fpdfapi/page/cpdf_pathobject.cpp
@@ -41,7 +41,8 @@ void CPDF_PathObject::CalcBoundingBox() {
} else {
rect = m_Path.GetBoundingBox();
}
- rect.Transform(&m_Matrix);
+ m_Matrix.TransformRect(rect);
+
if (width == 0 && m_bStroke) {
rect.left += -0.5f;
rect.right += 0.5f;
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index 28f3594f47..1fcb27a8c8 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -127,7 +127,7 @@ CFX_FloatRect GetShadingBBox(CPDF_ShadingPattern* pShading,
if (bGouraud)
stream.BitStream()->ByteAlign();
}
- rect.Transform(&matrix);
+ matrix.TransformRect(rect);
return rect;
}