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

Unified Diff: samples/pdfium_test.cc

Issue 935663003: Fix compilation error on Windows. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 10 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: samples/pdfium_test.cc
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 8f9c832fb223ed7394c751a53c0cd6de893bcb66..333f8e57e01f49d0f8ae4e309a2ea91266950459 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -446,14 +446,12 @@ void RenderPdf(const std::string& name, const char* pBuf, size_t len,
FORM_OnAfterLoadPage(page, form);
FORM_DoPageAAction(page, form, FPDFPAGE_AACTION_OPEN);
- int width = static_cast<int>(FPDF_GetPageWidth(page));
- int height = static_cast<int>(FPDF_GetPageHeight(page));
+ double scale = 1.0;
if (!options.scale_factor_as_string.empty()) {
- double scale = 1.0;
std::stringstream(options.scale_factor_as_string) >> scale;
- width *= scale;
- height *= scale;
}
+ int width = static_cast<int>(FPDF_GetPageWidth(page) * scale);
+ int height = static_cast<int>(FPDF_GetPageHeight(page) * scale);
FPDF_BITMAP bitmap = FPDFBitmap_Create(width, height, 0);
FPDFBitmap_FillRect(bitmap, 0, 0, width, height, 0xFFFFFFFF);
« 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