unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>, Drew Adams <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: RE: Display-relative coordinates
Date: Fri, 29 Jul 2016 08:38:19 -0700 (PDT)	[thread overview]
Message-ID: <4b77cdb3-e46a-4a9f-95ff-cfdb537c5538@default> (raw)
In-Reply-To: <<83d1lwr2at.fsf@gnu.org>>

> There is not enough information in the above, and also some surprising
> data.  First, you don't tell how you measure pixels from the screen
> corner.  

MB Ruler: http://www.markus-bader.de/MB-Ruler/index.php

> You don't tell what location of the character cells you take
> as its coordinates.

I did say that I measured to the bottom of the cursor (block).
And I did say that I got the char height as 12 pixels.

> You also say that the height of a character is 12 pixels, but
> the default height of a line in "emacs -Q" is 16, not 12.

I believe I measured it.  Measuring it again now: 12 pixels for
a char.  And in 1/10 pt, face `default' has height 102.  (And no,
char height does not include interline height.)

FWIW, in my emacs -Q:
(font . "-outline-Courier New-normal-normal-normal-mono-17-*-*-*-c-*-iso8859-1")

I mentioned char height only to let you know that I measured to
the bottom of the cursor (as I said).  If you want to instead
use the bottom of the cursor on the previous line (so as to
include the interline height), and you want to use 16, then
420 - 16 = 404, instead of the 420 - 12 = 408 that I reported
using char height.  Still not the same as 354.  Again, perhaps
I'm missing something.

> Maybe you could go line by line starting at the first line of the
> window, show the pixel coordinates of the first (leftmost) character
> on that line, and then tell which part(s) of the results don't look
> correct to you.

Sorry, I'm done with this.

> FWIW, if I move a frame such that point is at one of the 4 corners of
> the screen, and compute its pixel coordinates using posn-at-point and
> frame-geometry, I get a very good approximation (within a couple of
> pixels) of my screen dimensions, so I don't think there's a problem in
> these functions.

"Tout va tres bien, Madame La Marquise."

If you're convinced that `posn-at-point' has no problem, fine by me.

I think Martin answered the question of what to use, to get the
screen-relative pixel coordinates of a buffer position:
`window-absolute-pixel-position'.  (But it is not available before
Emacs 25.)



       reply	other threads:[~2016-07-29 15:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<<831t2dsu3y.fsf@gnu.org>
     [not found] ` <<bd748cdc-2ab2-4576-9e85-1040706ffcc8@default>
     [not found]   ` <<83d1lwr2at.fsf@gnu.org>
2016-07-29 15:38     ` Drew Adams [this message]
2016-07-29 17:42       ` Display-relative coordinates Eli Zaretskii
     [not found] <<831t2dsu3y.fsf@gnu.org>
2016-07-28 20:20 ` Drew Adams
2016-07-29 13:39   ` Eli Zaretskii
2016-07-28 14:41 Eli Zaretskii
2016-07-28 19:07 ` martin rudalics
2016-07-28 20:20   ` Drew Adams
2016-07-29  5:54     ` martin rudalics
2016-07-29 15:38       ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b77cdb3-e46a-4a9f-95ff-cfdb537c5538@default \
    --to=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).