unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 52142@debbugs.gnu.org
Subject: bug#52142: 28.0.60; `posn-object-width-height' does not reflect actual dimensions of object when confronted by display string
Date: Sat, 27 Nov 2021 20:47:07 +0800	[thread overview]
Message-ID: <87czmlahpw.fsf@yahoo.com> (raw)
In-Reply-To: <83ee71zslx.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 27 Nov 2021 14:32:42 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

> That's a feature.  Maybe it isn't documented clearly enough, but
> basically as long as there's a character displayed at that position,
> WIDTH and HEIGHT give the dimensions of that character's glyph on
> display.

Hmm, okay.  I think the documentation in (elisp)Click Events could do
with some improvement:

WIDTH, HEIGHT
     These are the pixel width and height of OBJECT or, if this is
     ‘nil’, those of the character glyph clicked on.

   For clicks on a scroll bar, POSITION has this form:

     (WINDOW AREA (PORTION . WHOLE) TIMESTAMP PART)

Should probably be

WIDTH, HEIGHT
     These are the pixel width and height of the character glyph clicked
     on, or, if none exists, the pixel width and height of OBJECT.

   For clicks on a scroll bar, POSITION has this form:

     (WINDOW AREA (PORTION . WHOLE) TIMESTAMP PART)


> Remember: this stuff was originally designed for mouse clicks, where
> it's important to know what did you click on.

Thanks.  On a slightly unrelated topic, what would be the appropriate
method to obtain the height of such a display string?  I'm trying to
make the pixel scrolling machinery work with such text, and while
scrolling down already works, I have no idea how to implement scrolling
up, which currently relies on going to the last screen line, then
adjusting vscroll the remainder of the way, which naturally requires a
way to fetch the height of the display string.





  reply	other threads:[~2021-11-27 12:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87v90dajvy.fsf.ref@yahoo.com>
2021-11-27 12:00 ` bug#52142: 28.0.60; `posn-object-width-height' does not reflect actual dimensions of object when confronted by display string Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-27 12:32   ` Eli Zaretskii
2021-11-27 12:47     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-11-27 13:03       ` Eli Zaretskii
2021-11-27 13:12         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-27 13:27           ` Eli Zaretskii

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=87czmlahpw.fsf@yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=52142@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.com \
    /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).