< prev index next >
src/java.desktop/windows/native/libawt/windows/awt_Font.cpp
Print this page
@@ -404,11 +404,11 @@
static int ScaleUpX(float x) {
int deviceIndex = AwtWin32GraphicsDevice::DeviceIndexForWindow(
::GetDesktopWindow());
Devices::InstanceAccess devices;
AwtWin32GraphicsDevice *device = devices->GetDevice(deviceIndex);
- return device == NULL ? x : device->ScaleUpX(x);
+ return static_cast<int>(device == NULL ? x : device->ScaleUpX(static_cast<int>(x)));
}
static int ScaleUpY(int y) {
int deviceIndex = AwtWin32GraphicsDevice::DeviceIndexForWindow(
::GetDesktopWindow());
@@ -484,11 +484,11 @@
oldFont = (HFONT)::SelectObject(hDC, oldFont);
if (oldFont != NULL) { // should be the same as hFont
VERIFY(::DeleteObject(oldFont));
}
avgWidth = tm.tmAveCharWidth;
- logFont.lfWidth = (LONG) ScaleUpX((fabs) (avgWidth * awScale));
+ logFont.lfWidth = (LONG) ScaleUpX(static_cast<float>((fabs) (avgWidth * awScale)));
hFont = ::CreateFontIndirect(&logFont);
DASSERT(hFont != NULL);
VERIFY(::ReleaseDC(0, hDC));
}
< prev index next >