mirror of
https://github.com/reactos/reactos.git
synced 2024-07-08 05:35:06 +00:00
[VBEMP]
Fix rounding error when calculating display size Loosely based on patch by neoman. Fixes gdi32_winetest:mapping See issue #5790 for more details. svn path=/trunk/; revision=50112
This commit is contained in:
parent
7ea8c55b57
commit
ac56cac80c
|
@ -847,6 +847,7 @@ VBEQueryMode(
|
||||||
ULONG VideoModeId)
|
ULONG VideoModeId)
|
||||||
{
|
{
|
||||||
PVBE_MODEINFO VBEMode = &DeviceExtension->ModeInfo[VideoModeId];
|
PVBE_MODEINFO VBEMode = &DeviceExtension->ModeInfo[VideoModeId];
|
||||||
|
ULONG dpi;
|
||||||
|
|
||||||
VideoMode->Length = sizeof(VIDEO_MODE_INFORMATION);
|
VideoMode->Length = sizeof(VIDEO_MODE_INFORMATION);
|
||||||
VideoMode->ModeIndex = VideoModeId;
|
VideoMode->ModeIndex = VideoModeId;
|
||||||
|
@ -860,9 +861,10 @@ VBEQueryMode(
|
||||||
VideoMode->BitsPerPlane = VBEMode->BitsPerPixel / VBEMode->NumberOfPlanes;
|
VideoMode->BitsPerPlane = VBEMode->BitsPerPixel / VBEMode->NumberOfPlanes;
|
||||||
VideoMode->Frequency = 1;
|
VideoMode->Frequency = 1;
|
||||||
|
|
||||||
/* Assume 96DPI and 25.4 millimeters per inch */
|
/* Assume 96DPI and 25.4 millimeters per inch, round to nearest */
|
||||||
VideoMode->XMillimeter = VBEMode->XResolution * 254 / 960;
|
dpi = 96;
|
||||||
VideoMode->YMillimeter = VBEMode->YResolution * 254 / 960;
|
VideoMode->XMillimeter = ((ULONGLONG)VBEMode->XResolution * 254 + (dpi * 5)) / (dpi * 10);
|
||||||
|
VideoMode->YMillimeter = ((ULONGLONG)VBEMode->YResolution * 254 + (dpi * 5)) / (dpi * 10);
|
||||||
|
|
||||||
if (VBEMode->BitsPerPixel > 8)
|
if (VBEMode->BitsPerPixel > 8)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue