1 // Copyright 2014 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.
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_pageobj.h"
9 #include "../../../include/fpdfapi/fpdf_module.h"
11 void CPDF_PathObject::CopyData(const CPDF_PageObject* pSrc)
13 const CPDF_PathObject* pSrcObj = (const CPDF_PathObject*)pSrc;
14 m_Path = pSrcObj->m_Path;
15 m_FillType = pSrcObj->m_FillType;
16 m_bStroke = pSrcObj->m_bStroke;
17 m_Matrix = pSrcObj->m_Matrix;
19 void CPDF_PathObject::Transform(const CPDF_Matrix& matrix)
21 m_Matrix.Concat(matrix);
24 void CPDF_PathObject::SetGraphState(CPDF_GraphState GraphState)
26 m_GraphState = GraphState;
29 void CPDF_PathObject::CalcBoundingBox()
31 if (m_Path.IsNull()) {
35 FX_FLOAT width = m_GraphState.GetObject()->m_LineWidth;
36 if (m_bStroke && width != 0) {
37 rect = m_Path.GetBoundingBox(width, m_GraphState.GetObject()->m_MiterLimit);
39 rect = m_Path.GetBoundingBox();
41 rect.Transform(&m_Matrix);
42 if (width == 0 && m_bStroke) {
51 m_Bottom = rect.bottom;