diff options
Diffstat (limited to 'backends')
-rw-r--r-- | backends/graphics/windowed.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backends/graphics/windowed.h b/backends/graphics/windowed.h index 1d4958c9d6..5f89d2d233 100644 --- a/backends/graphics/windowed.h +++ b/backends/graphics/windowed.h @@ -94,8 +94,8 @@ protected: error("convertVirtualToWindow called without a valid draw rect"); } - return Common::Point(targetX + x * targetWidth / sourceWidth, - targetY + y * targetHeight / sourceHeight); + return Common::Point(targetX + (x * targetWidth + sourceWidth / 2) / sourceWidth, + targetY + (y * targetHeight + sourceHeight / 2) / sourceHeight); } /** @@ -120,8 +120,8 @@ protected: x = CLIP<int>(x, sourceX, sourceMaxX); y = CLIP<int>(y, sourceY, sourceMaxY); - return Common::Point(((x - sourceX) * targetWidth) / sourceWidth, - ((y - sourceY) * targetHeight) / sourceHeight); + return Common::Point(((x - sourceX) * targetWidth + sourceWidth / 2) / sourceWidth, + ((y - sourceY) * targetHeight + sourceHeight / 2) / sourceHeight); } /** |