--- old/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.h 2017-10-24 12:45:44.140952080 +0530 +++ new/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.h 2017-10-24 12:45:43.816790080 +0530 @@ -119,7 +119,7 @@ float scaleY; static HDC MakeDCFromMonitor(HMONITOR); - static int CheckIntLimits(double value); + static int ClipRound(double value); }; #endif AWT_WIN32GRAPHICSDEVICE_H --- old/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.cpp 2017-10-24 12:45:44.821292081 +0530 +++ new/src/java.desktop/windows/native/libawt/windows/awt_Win32GraphicsDevice.cpp 2017-10-24 12:45:44.553158081 +0530 @@ -632,26 +632,27 @@ int AwtWin32GraphicsDevice::ScaleUpX(int x) { - return CheckIntLimits(x * scaleX); + return ClipRound(x * scaleX); } int AwtWin32GraphicsDevice::ScaleUpY(int y) { - return CheckIntLimits(y * scaleY); + return ClipRound(y * scaleY); } int AwtWin32GraphicsDevice::ScaleDownX(int x) { - return CheckIntLimits(x / scaleX); + return ClipRound(x / scaleX); } int AwtWin32GraphicsDevice::ScaleDownY(int y) { - return CheckIntLimits(y / scaleY); + return ClipRound(y / scaleY); } -int AwtWin32GraphicsDevice::CheckIntLimits(double value) +int AwtWin32GraphicsDevice::ClipRound(double value) { + value -= 0.5; if (value < INT_MIN) { return INT_MIN;