Skip to content

Commit

Permalink
vs2015: avoid int->float warning in printing/emf_win.cc
Browse files Browse the repository at this point in the history
d:\src\cr2\src\printing\emf_win.cc(548): warning C4838: conversion from 'int' to 'FLOAT' requires a narrowing conversion
d:\src\cr2\src\printing\emf_win.cc(569): warning C4838: conversion from 'int' to 'FLOAT' requires a narrowing conversion

R=alekseys@chromium.org
BUG=440500

Review URL: https://codereview.chromium.org/1113113002

Cr-Commit-Position: refs/heads/master@{#327781}
  • Loading branch information
sgraham authored and Commit bot committed Apr 30, 2015
1 parent f216941 commit 76cb786
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions printing/emf_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ scoped_ptr<Emf> Emf::RasterizeMetafile(int raster_area_in_pixels) const {
XFORM xform = {
float(page_bounds.width()) / bitmap_rect.width(), 0,
0, float(page_bounds.height()) / bitmap_rect.height(),
page_bounds.x(),
page_bounds.y(),
static_cast<float>(page_bounds.x()),
static_cast<float>(page_bounds.y()),
};
::SetWorldTransform(hdc, &xform);
::BitBlt(hdc, 0, 0, bitmap_rect.width(), bitmap_rect.height(),
Expand All @@ -577,7 +577,12 @@ scoped_ptr<Emf> Emf::RasterizeAlphaBlend() const {
RasterBitmap bitmap(page_bounds.size());

// Map metafile page_bounds.x(), page_bounds.y() to bitmap 0, 0.
XFORM xform = { 1, 0, 0, 1, -page_bounds.x(), -page_bounds.y()};
XFORM xform = {1,
0,
0,
1,
static_cast<float>(-page_bounds.x()),
static_cast<float>(-page_bounds.y())};
::SetWorldTransform(bitmap.context(), &xform);

scoped_ptr<Emf> result(new Emf);
Expand Down

0 comments on commit 76cb786

Please sign in to comment.