OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 |
| 7 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" |
| 8 |
| 9 CPDF_PageObject::CPDF_PageObject() {} |
| 10 |
| 11 CPDF_PageObject::~CPDF_PageObject() {} |
| 12 |
| 13 void CPDF_PageObject::CopyData(const CPDF_PageObject* pSrc) { |
| 14 CopyStates(*pSrc); |
| 15 m_Left = pSrc->m_Left; |
| 16 m_Right = pSrc->m_Right; |
| 17 m_Top = pSrc->m_Top; |
| 18 m_Bottom = pSrc->m_Bottom; |
| 19 } |
| 20 |
| 21 void CPDF_PageObject::TransformClipPath(CFX_Matrix& matrix) { |
| 22 if (m_ClipPath.IsNull()) { |
| 23 return; |
| 24 } |
| 25 m_ClipPath.GetModify(); |
| 26 m_ClipPath.Transform(matrix); |
| 27 } |
| 28 |
| 29 void CPDF_PageObject::TransformGeneralState(CFX_Matrix& matrix) { |
| 30 if (m_GeneralState.IsNull()) { |
| 31 return; |
| 32 } |
| 33 CPDF_GeneralStateData* pGS = m_GeneralState.GetModify(); |
| 34 pGS->m_Matrix.Concat(matrix); |
| 35 } |
| 36 |
| 37 FX_RECT CPDF_PageObject::GetBBox(const CFX_Matrix* pMatrix) const { |
| 38 CFX_FloatRect rect(m_Left, m_Bottom, m_Right, m_Top); |
| 39 if (pMatrix) { |
| 40 pMatrix->TransformRect(rect); |
| 41 } |
| 42 return rect.GetOutterRect(); |
| 43 } |
OLD | NEW |