emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: display-mm-width return value off on Windows


From: Ralf Angeli
Subject: Re: display-mm-width return value off on Windows
Date: Fri, 07 Jul 2006 07:50:08 +0200

* Jason Rumney (2006-07-07) writes:

> Ralf Angeli <address@hidden> writes:
>
>> -  cap = GetDeviceCaps (hdc, VERTSIZE);
>> +  height = round (GetDeviceCaps (hdc, VERTRES)
>> +              / GetDeviceCaps (hdc, LOGPIXELSY) * 25.4);
>
>> -  cap = GetDeviceCaps (hdc, HORZSIZE);
>> +  width = round (GetDeviceCaps (hdc, HORZRES)
>> +             / GetDeviceCaps (hdc, LOGPIXELSX) * 25.4);
>
> Do these get any more accurate if you move the multiplication to
> before the division?

Then I get 296 for the width and 222 for the height.  Here are the
values from my other mail for reference:

|                    display-mm-*   display-mm-*
|         Real size  without patch  with patch
| Width   285mm      370            279
| Height  215mm      277            203
| 

> If so, it might be worth changing. Otherwise, the results look just as
> broken as what we have now.

At least for the two cases at hand the change yields better results
than before.  They are closer to the real values and e.g. for the
other user better match the screens aspect ratio.

> You may have found two cases where the
> results were closer, but it does not follow that they will always be
> so if they are still wildly inaccurate.

It might be worth gathering more data points.

-- 
Ralf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]