summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/page/cpdf_pathobject.cpp8
-rw-r--r--core/fpdfapi/page/cpdf_textobject.cpp5
2 files changed, 3 insertions, 10 deletions
diff --git a/core/fpdfapi/page/cpdf_pathobject.cpp b/core/fpdfapi/page/cpdf_pathobject.cpp
index 84cf45d7e0..4fb8f10a6b 100644
--- a/core/fpdfapi/page/cpdf_pathobject.cpp
+++ b/core/fpdfapi/page/cpdf_pathobject.cpp
@@ -47,11 +47,7 @@ void CPDF_PathObject::CalcBoundingBox() {
}
rect = m_Matrix.TransformRect(rect);
- if (width == 0 && m_bStroke) {
- rect.left += -0.5f;
- rect.right += 0.5f;
- rect.bottom += -0.5f;
- rect.top += 0.5f;
- }
+ if (width == 0 && m_bStroke)
+ rect.Inflate(0.5f, 0.5f);
SetRect(rect);
}
diff --git a/core/fpdfapi/page/cpdf_textobject.cpp b/core/fpdfapi/page/cpdf_textobject.cpp
index b158376293..2b866baa25 100644
--- a/core/fpdfapi/page/cpdf_textobject.cpp
+++ b/core/fpdfapi/page/cpdf_textobject.cpp
@@ -293,10 +293,7 @@ void CPDF_TextObject::SetPosition(float x, float y) {
float dy = y - m_Pos.y;
m_Pos.x = x;
m_Pos.y = y;
- m_Rect.left += dx;
- m_Rect.right += dx;
- m_Rect.top += dy;
- m_Rect.bottom += dy;
+ m_Rect.Translate(dx, dy);
}
void CPDF_TextObject::RecalcPositionData() {