summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_textobject.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-06 00:32:16 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-06 00:32:16 +0000
commitd9826495fe0e279c6e2d587a656c7452cc2dc71f (patch)
tree0256f8903da70445c5f8e21b62c01d2d70385201 /core/fpdfapi/page/cpdf_textobject.cpp
parenta0032a2a2c53794bbf0ccb412a5c70ce66f052fb (diff)
downloadpdfium-d9826495fe0e279c6e2d587a656c7452cc2dc71f.tar.xz
Encapsulate CPDF_PageObject's rect member.
At the same time, change it from 4 floats to a CFX_FloatRect. Change-Id: I00ded941723d6a264b7a17c73fd337e66b449308 Reviewed-on: https://pdfium-review.googlesource.com/c/43570 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_textobject.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_textobject.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/core/fpdfapi/page/cpdf_textobject.cpp b/core/fpdfapi/page/cpdf_textobject.cpp
index 84428fee81..b158376293 100644
--- a/core/fpdfapi/page/cpdf_textobject.cpp
+++ b/core/fpdfapi/page/cpdf_textobject.cpp
@@ -273,17 +273,17 @@ CFX_PointF CPDF_TextObject::CalcPositionData(float horz_scale) {
min_y = min_y * fontsize / 1000;
max_y = max_y * fontsize / 1000;
}
- std::tie(m_Left, m_Right, m_Top, m_Bottom) =
- GetTextMatrix().TransformRect(min_x, max_x, max_y, min_y);
+ SetRect(
+ GetTextMatrix().TransformRect(CFX_FloatRect(min_x, min_y, max_x, max_y)));
if (!TextRenderingModeIsStrokeMode(m_TextState.GetTextMode()))
return ret;
float half_width = m_GraphState.GetLineWidth() / 2;
- m_Left -= half_width;
- m_Right += half_width;
- m_Top += half_width;
- m_Bottom -= half_width;
+ m_Rect.left -= half_width;
+ m_Rect.right += half_width;
+ m_Rect.top += half_width;
+ m_Rect.bottom -= half_width;
return ret;
}
@@ -293,10 +293,10 @@ void CPDF_TextObject::SetPosition(float x, float y) {
float dy = y - m_Pos.y;
m_Pos.x = x;
m_Pos.y = y;
- m_Left += dx;
- m_Right += dx;
- m_Top += dy;
- m_Bottom += dy;
+ m_Rect.left += dx;
+ m_Rect.right += dx;
+ m_Rect.top += dy;
+ m_Rect.bottom += dy;
}
void CPDF_TextObject::RecalcPositionData() {