aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index ec215bb38..374ee9fd3 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -857,10 +857,10 @@ void SurfaceGDI::DrawRGBAImage(PRectangle rc, int width, int height, const unsig
if (rc.Width() > 0) {
HDC hMemDC = ::CreateCompatibleDC(hdc);
if (rc.Width() > width)
- rc.left += static_cast<int>((rc.Width() - width) / 2);
+ rc.left += floor((rc.Width() - width) / 2);
rc.right = rc.left + width;
if (rc.Height() > height)
- rc.top += static_cast<int>((rc.Height() - height) / 2);
+ rc.top += floor((rc.Height() - height) / 2);
rc.bottom = rc.top + height;
const BITMAPINFO bpih = {{sizeof(BITMAPINFOHEADER), width, height, 1, 32, BI_RGB, 0, 0, 0, 0, 0},
@@ -1472,10 +1472,10 @@ void SurfaceD2D::AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fil
void SurfaceD2D::DrawRGBAImage(PRectangle rc, int width, int height, const unsigned char *pixelsImage) {
if (pRenderTarget) {
if (rc.Width() > width)
- rc.left += static_cast<int>((rc.Width() - width) / 2);
+ rc.left += floor((rc.Width() - width) / 2);
rc.right = rc.left + width;
if (rc.Height() > height)
- rc.top += static_cast<int>((rc.Height() - height) / 2);
+ rc.top += floor((rc.Height() - height) / 2);
rc.bottom = rc.top + height;
std::vector<unsigned char> image(height * width * 4);