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

Unified Diff: ui/gfx/gdi_util.cc

Issue 641923002: Change PDF scaling factor from double to float. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 6 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 | « ui/gfx/gdi_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gdi_util.cc
diff --git a/ui/gfx/gdi_util.cc b/ui/gfx/gdi_util.cc
index dc7d83f37cf64f843de3e06181defe1b7acc357a..3030a533462e668a129577d484e23791d799814b 100644
--- a/ui/gfx/gdi_util.cc
+++ b/ui/gfx/gdi_util.cc
@@ -96,7 +96,7 @@ HRGN ConvertPathToHRGN(const gfx::Path& path) {
}
-double CalculatePageScale(HDC dc, int page_width, int page_height) {
+float CalculatePageScale(HDC dc, int page_width, int page_height) {
int dc_width = GetDeviceCaps(dc, HORZRES);
int dc_height = GetDeviceCaps(dc, VERTRES);
@@ -104,15 +104,15 @@ double CalculatePageScale(HDC dc, int page_width, int page_height) {
if (dc_width >= page_width && dc_height >= page_height)
return 1.0;
- double x_factor =
- static_cast<double>(dc_width) / static_cast<double>(page_width);
- double y_factor =
- static_cast<double>(dc_height) / static_cast<double>(page_height);
+ float x_factor =
+ static_cast<float>(dc_width) / static_cast<float>(page_width);
+ float y_factor =
+ static_cast<float>(dc_height) / static_cast<float>(page_height);
return std::min(x_factor, y_factor);
}
// Apply scaling to the DC.
-bool ScaleDC(HDC dc, double scale_factor) {
+bool ScaleDC(HDC dc, float scale_factor) {
SetGraphicsMode(dc, GM_ADVANCED);
XFORM xform = {0};
xform.eM11 = xform.eM22 = scale_factor;
« no previous file with comments | « ui/gfx/gdi_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698