OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/fpdfapi/fpdf_page/include/cpdf_page.h" | 7 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" | 9 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobject.h" |
10 #include "core/fpdfapi/fpdf_page/pageint.h" | 10 #include "core/fpdfapi/fpdf_page/pageint.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void CPDF_Page::GetDisplayMatrix(CFX_Matrix& matrix, | 133 void CPDF_Page::GetDisplayMatrix(CFX_Matrix& matrix, |
134 int xPos, | 134 int xPos, |
135 int yPos, | 135 int yPos, |
136 int xSize, | 136 int xSize, |
137 int ySize, | 137 int ySize, |
138 int iRotate) const { | 138 int iRotate) const { |
139 if (m_PageWidth == 0 || m_PageHeight == 0) { | 139 if (m_PageWidth == 0 || m_PageHeight == 0) { |
140 return; | 140 return; |
141 } | 141 } |
142 CFX_Matrix display_matrix; | 142 CFX_Matrix display_matrix; |
143 int x0, y0, x1, y1, x2, y2; | 143 int x0 = 0; |
| 144 int y0 = 0; |
| 145 int x1 = 0; |
| 146 int y1 = 0; |
| 147 int x2 = 0; |
| 148 int y2 = 0; |
144 iRotate %= 4; | 149 iRotate %= 4; |
145 switch (iRotate) { | 150 switch (iRotate) { |
146 case 0: | 151 case 0: |
147 x0 = xPos; | 152 x0 = xPos; |
148 y0 = yPos + ySize; | 153 y0 = yPos + ySize; |
149 x1 = xPos; | 154 x1 = xPos; |
150 y1 = yPos; | 155 y1 = yPos; |
151 x2 = xPos + xSize; | 156 x2 = xPos + xSize; |
152 y2 = yPos + ySize; | 157 y2 = yPos + ySize; |
153 break; | 158 break; |
(...skipping 22 matching lines...) Expand all Loading... |
176 y2 = yPos; | 181 y2 = yPos; |
177 break; | 182 break; |
178 } | 183 } |
179 display_matrix.Set( | 184 display_matrix.Set( |
180 ((FX_FLOAT)(x2 - x0)) / m_PageWidth, ((FX_FLOAT)(y2 - y0)) / m_PageWidth, | 185 ((FX_FLOAT)(x2 - x0)) / m_PageWidth, ((FX_FLOAT)(y2 - y0)) / m_PageWidth, |
181 ((FX_FLOAT)(x1 - x0)) / m_PageHeight, | 186 ((FX_FLOAT)(x1 - x0)) / m_PageHeight, |
182 ((FX_FLOAT)(y1 - y0)) / m_PageHeight, (FX_FLOAT)x0, (FX_FLOAT)y0); | 187 ((FX_FLOAT)(y1 - y0)) / m_PageHeight, (FX_FLOAT)x0, (FX_FLOAT)y0); |
183 matrix = m_PageMatrix; | 188 matrix = m_PageMatrix; |
184 matrix.Concat(display_matrix); | 189 matrix.Concat(display_matrix); |
185 } | 190 } |
OLD | NEW |