mirror of
https://github.com/reactos/reactos.git
synced 2025-01-04 21:38:43 +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
1 changed files with 5 additions and 3 deletions
|
@ -847,6 +847,7 @@ VBEQueryMode(
|
|||
ULONG VideoModeId)
|
||||
{
|
||||
PVBE_MODEINFO VBEMode = &DeviceExtension->ModeInfo[VideoModeId];
|
||||
ULONG dpi;
|
||||
|
||||
VideoMode->Length = sizeof(VIDEO_MODE_INFORMATION);
|
||||
VideoMode->ModeIndex = VideoModeId;
|
||||
|
@ -860,9 +861,10 @@ VBEQueryMode(
|
|||
VideoMode->BitsPerPlane = VBEMode->BitsPerPixel / VBEMode->NumberOfPlanes;
|
||||
VideoMode->Frequency = 1;
|
||||
|
||||
/* Assume 96DPI and 25.4 millimeters per inch */
|
||||
VideoMode->XMillimeter = VBEMode->XResolution * 254 / 960;
|
||||
VideoMode->YMillimeter = VBEMode->YResolution * 254 / 960;
|
||||
/* Assume 96DPI and 25.4 millimeters per inch, round to nearest */
|
||||
dpi = 96;
|
||||
VideoMode->XMillimeter = ((ULONGLONG)VBEMode->XResolution * 254 + (dpi * 5)) / (dpi * 10);
|
||||
VideoMode->YMillimeter = ((ULONGLONG)VBEMode->YResolution * 254 + (dpi * 5)) / (dpi * 10);
|
||||
|
||||
if (VBEMode->BitsPerPixel > 8)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue