diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-06 00:32:16 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-06 00:32:16 +0000 |
commit | d9826495fe0e279c6e2d587a656c7452cc2dc71f (patch) | |
tree | 0256f8903da70445c5f8e21b62c01d2d70385201 /core/fpdfapi/page/cpdf_shadingobject.cpp | |
parent | a0032a2a2c53794bbf0ccb412a5c70ce66f052fb (diff) | |
download | pdfium-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_shadingobject.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_shadingobject.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/core/fpdfapi/page/cpdf_shadingobject.cpp b/core/fpdfapi/page/cpdf_shadingobject.cpp index 725e2e4591..bdaceaa7e8 100644 --- a/core/fpdfapi/page/cpdf_shadingobject.cpp +++ b/core/fpdfapi/page/cpdf_shadingobject.cpp @@ -27,10 +27,10 @@ void CPDF_ShadingObject::Transform(const CFX_Matrix& matrix) { m_Matrix.Concat(matrix); if (m_ClipPath.HasRef()) { CalcBoundingBox(); - } else { - std::tie(m_Left, m_Right, m_Top, m_Bottom) = - matrix.TransformRect(m_Left, m_Right, m_Top, m_Bottom); + return; } + + SetRect(matrix.TransformRect(GetRect())); } bool CPDF_ShadingObject::IsShading() const { @@ -48,9 +48,5 @@ const CPDF_ShadingObject* CPDF_ShadingObject::AsShading() const { void CPDF_ShadingObject::CalcBoundingBox() { if (!m_ClipPath.HasRef()) return; - CFX_FloatRect rect = m_ClipPath.GetClipBox(); - m_Left = rect.left; - m_Bottom = rect.bottom; - m_Right = rect.right; - m_Top = rect.top; + SetRect(m_ClipPath.GetClipBox()); } |