From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: display-mm-width return value off on Windows Date: Thu, 06 Jul 2006 23:09:36 +0100 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1152223938 16715 80.91.229.2 (6 Jul 2006 22:12:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Jul 2006 22:12:18 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 07 00:12:14 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fyc4t-0006wV-Ve for ged-emacs-devel@m.gmane.org; Fri, 07 Jul 2006 00:12:08 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fyc4t-0007M6-Dz for ged-emacs-devel@m.gmane.org; Thu, 06 Jul 2006 18:12:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fyc4g-0007M0-3I for emacs-devel@gnu.org; Thu, 06 Jul 2006 18:11:54 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fyc4e-0007LD-Ke for emacs-devel@gnu.org; Thu, 06 Jul 2006 18:11:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fyc4e-0007L7-FT for emacs-devel@gnu.org; Thu, 06 Jul 2006 18:11:52 -0400 Original-Received: from [194.106.33.237] (helo=outmail.freedom2surf.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fyc4v-0001if-OA for emacs-devel@gnu.org; Thu, 06 Jul 2006 18:12:09 -0400 Original-Received: from wanchan.jasonrumney.net (i-83-67-23-108.freedom2surf.net [83.67.23.108]) by outmail.freedom2surf.net (Postfix) with ESMTP id DB0B66CD323; Thu, 6 Jul 2006 23:11:30 +0100 (BST) Original-Received: from TONKOTSU-RAMEN (tonkotsu-ramen.jasonrumney.net [10.0.0.28]) by wanchan.jasonrumney.net (Postfix) with ESMTP id 9B82E6E5; Thu, 6 Jul 2006 23:11:30 +0100 (BST) Original-To: Ralf Angeli In-Reply-To: (Ralf Angeli's message of "Thu, 06 Jul 2006 19:50:26 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56668 Archived-At: Ralf Angeli 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.