Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: core/src/fpdfapi/fpdf_page/fpdf_page_path.cpp

Issue 1265503005: clang-format all pdfium code. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: sigh Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../include/fpdfapi/fpdf_page.h" 7 #include "../../../include/fpdfapi/fpdf_page.h"
8 #include "../../../include/fpdfapi/fpdf_pageobj.h" 8 #include "../../../include/fpdfapi/fpdf_pageobj.h"
9 #include "../../../include/fpdfapi/fpdf_module.h" 9 #include "../../../include/fpdfapi/fpdf_module.h"
10 #include "pageint.h" 10 #include "pageint.h"
11 void CPDF_PathObject::CopyData(const CPDF_PageObject* pSrc) 11 void CPDF_PathObject::CopyData(const CPDF_PageObject* pSrc) {
12 { 12 const CPDF_PathObject* pSrcObj = (const CPDF_PathObject*)pSrc;
13 const CPDF_PathObject* pSrcObj = (const CPDF_PathObject*)pSrc; 13 m_Path = pSrcObj->m_Path;
14 m_Path = pSrcObj->m_Path; 14 m_FillType = pSrcObj->m_FillType;
15 m_FillType = pSrcObj->m_FillType; 15 m_bStroke = pSrcObj->m_bStroke;
16 m_bStroke = pSrcObj->m_bStroke; 16 m_Matrix = pSrcObj->m_Matrix;
17 m_Matrix = pSrcObj->m_Matrix;
18 } 17 }
19 void CPDF_PathObject::Transform(const CPDF_Matrix& matrix) 18 void CPDF_PathObject::Transform(const CPDF_Matrix& matrix) {
20 { 19 m_Matrix.Concat(matrix);
21 m_Matrix.Concat(matrix); 20 CalcBoundingBox();
22 CalcBoundingBox();
23 } 21 }
24 void CPDF_PathObject::SetGraphState(CPDF_GraphState GraphState) 22 void CPDF_PathObject::SetGraphState(CPDF_GraphState GraphState) {
25 { 23 m_GraphState = GraphState;
26 m_GraphState = GraphState; 24 CalcBoundingBox();
27 CalcBoundingBox();
28 } 25 }
29 void CPDF_PathObject::CalcBoundingBox() 26 void CPDF_PathObject::CalcBoundingBox() {
30 { 27 if (m_Path.IsNull()) {
31 if (m_Path.IsNull()) { 28 return;
32 return; 29 }
33 } 30 CFX_FloatRect rect;
34 CFX_FloatRect rect; 31 FX_FLOAT width = m_GraphState.GetObject()->m_LineWidth;
35 FX_FLOAT width = m_GraphState.GetObject()->m_LineWidth; 32 if (m_bStroke && width != 0) {
36 if (m_bStroke && width != 0) { 33 rect = m_Path.GetBoundingBox(width, m_GraphState.GetObject()->m_MiterLimit);
37 rect = m_Path.GetBoundingBox(width, m_GraphState.GetObject()->m_MiterLim it); 34 } else {
38 } else { 35 rect = m_Path.GetBoundingBox();
39 rect = m_Path.GetBoundingBox(); 36 }
40 } 37 rect.Transform(&m_Matrix);
41 rect.Transform(&m_Matrix); 38 if (width == 0 && m_bStroke) {
42 if (width == 0 && m_bStroke) { 39 rect.left += -0.5f;
43 rect.left += -0.5f; 40 rect.right += 0.5f;
44 rect.right += 0.5f; 41 rect.bottom += -0.5f;
45 rect.bottom += -0.5f; 42 rect.top += 0.5f;
46 rect.top += 0.5f; 43 }
47 } 44 m_Left = rect.left;
48 m_Left = rect.left; 45 m_Right = rect.right;
49 m_Right = rect.right; 46 m_Top = rect.top;
50 m_Top = rect.top; 47 m_Bottom = rect.bottom;
51 m_Bottom = rect.bottom;
52 } 48 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698