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

Unified Diff: core/fpdfapi/page/cpdf_page.cpp

Issue 2412983002: Convert from int to float values. (Closed)
Patch Set: Win fix. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/page/cpdf_page.cpp
diff --git a/core/fpdfapi/page/cpdf_page.cpp b/core/fpdfapi/page/cpdf_page.cpp
index 89d0b35f3e0cb0a0960185c8b6c099a4bcbf6056..2143ddb0152304e2d607d7778493a7c346bed979 100644
--- a/core/fpdfapi/page/cpdf_page.cpp
+++ b/core/fpdfapi/page/cpdf_page.cpp
@@ -126,12 +126,12 @@ void CPDF_Page::GetDisplayMatrix(CFX_Matrix& matrix,
return;
}
CFX_Matrix display_matrix;
- int x0 = 0;
- int y0 = 0;
- int x1 = 0;
- int y1 = 0;
- int x2 = 0;
- int y2 = 0;
+ float x0 = 0;
+ float y0 = 0;
+ float x1 = 0;
+ float y1 = 0;
+ float x2 = 0;
+ float y2 = 0;
iRotate %= 4;
switch (iRotate) {
case 0:
@@ -167,10 +167,9 @@ void CPDF_Page::GetDisplayMatrix(CFX_Matrix& matrix,
y2 = yPos;
break;
}
- display_matrix.Set(
- ((FX_FLOAT)(x2 - x0)) / m_PageWidth, ((FX_FLOAT)(y2 - y0)) / m_PageWidth,
- ((FX_FLOAT)(x1 - x0)) / m_PageHeight,
- ((FX_FLOAT)(y1 - y0)) / m_PageHeight, (FX_FLOAT)x0, (FX_FLOAT)y0);
+ display_matrix.Set((x2 - x0) / m_PageWidth, (y2 - y0) / m_PageWidth,
+ (x1 - x0) / m_PageHeight, (y1 - y0) / m_PageHeight, x0,
+ y0);
matrix = m_PageMatrix;
matrix.Concat(display_matrix);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698