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: Jason Rumney
Subject: Re: display-mm-width return value off on Windows
Date: Thu, 06 Jul 2006 23:09:36 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt)

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?

   cap = round (25.4 * GetDeviceCaps (hdc, VERTRES)
                / GetDeviceCaps (hdc, LOGPIXELSY));


If so, it might be worth changing. Otherwise, the results look just as
broken as what we have now. 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.





reply via email to

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