OLD | NEW |
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 "fpdfsdk/fxedit/include/fxet_edit.h" | 7 #include "fpdfsdk/fxedit/include/fxet_edit.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 nullptr, &ro); | 130 nullptr, &ro); |
131 } | 131 } |
132 } | 132 } |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 void AddRectToPageObjects(CPDF_PageObjectHolder* pObjectHolder, | 136 void AddRectToPageObjects(CPDF_PageObjectHolder* pObjectHolder, |
137 FX_COLORREF crFill, | 137 FX_COLORREF crFill, |
138 const CFX_FloatRect& rcFill) { | 138 const CFX_FloatRect& rcFill) { |
139 std::unique_ptr<CPDF_PathObject> pPathObj(new CPDF_PathObject); | 139 std::unique_ptr<CPDF_PathObject> pPathObj(new CPDF_PathObject); |
140 CFX_PathData* pPathData = pPathObj->m_Path.GetPrivateCopy(); | 140 pPathObj->m_Path.AppendRect(rcFill.left, rcFill.bottom, rcFill.right, |
141 pPathData->AppendRect(rcFill.left, rcFill.bottom, rcFill.right, rcFill.top); | 141 rcFill.top); |
142 | 142 |
143 FX_FLOAT rgb[3]; | 143 FX_FLOAT rgb[3]; |
144 rgb[0] = FXARGB_R(crFill) / 255.0f; | 144 rgb[0] = FXARGB_R(crFill) / 255.0f; |
145 rgb[1] = FXARGB_G(crFill) / 255.0f; | 145 rgb[1] = FXARGB_G(crFill) / 255.0f; |
146 rgb[2] = FXARGB_B(crFill) / 255.0f; | 146 rgb[2] = FXARGB_B(crFill) / 255.0f; |
147 pPathObj->m_ColorState.SetFillColor( | 147 pPathObj->m_ColorState.SetFillColor( |
148 CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3); | 148 CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3); |
149 | 149 |
150 pPathObj->m_FillType = FXFILL_ALTERNATE; | 150 pPathObj->m_FillType = FXFILL_ALTERNATE; |
151 pPathObj->m_bStroke = FALSE; | 151 pPathObj->m_bStroke = FALSE; |
(...skipping 2904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3056 int32_t CFX_Edit_RectArray::GetSize() const { | 3056 int32_t CFX_Edit_RectArray::GetSize() const { |
3057 return m_Rects.GetSize(); | 3057 return m_Rects.GetSize(); |
3058 } | 3058 } |
3059 | 3059 |
3060 CFX_FloatRect* CFX_Edit_RectArray::GetAt(int32_t nIndex) const { | 3060 CFX_FloatRect* CFX_Edit_RectArray::GetAt(int32_t nIndex) const { |
3061 if (nIndex < 0 || nIndex >= m_Rects.GetSize()) | 3061 if (nIndex < 0 || nIndex >= m_Rects.GetSize()) |
3062 return nullptr; | 3062 return nullptr; |
3063 | 3063 |
3064 return m_Rects.GetAt(nIndex); | 3064 return m_Rects.GetAt(nIndex); |
3065 } | 3065 } |
OLD | NEW |