all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: JD Smith <jdtsmith@gmail.com>
Cc: 67533@debbugs.gnu.org
Subject: bug#67533: SVG images confound position pixel measurements
Date: Fri, 01 Dec 2023 09:08:44 +0200	[thread overview]
Message-ID: <837clybds3.fsf@gnu.org> (raw)
In-Reply-To: <6158BB83-3C05-4CEC-BF65-A6C0DEA329CD@gmail.com> (message from JD Smith on Thu, 30 Nov 2023 16:00:09 -0500)

> From: JD Smith <jdtsmith@gmail.com>
> Date: Thu, 30 Nov 2023 16:00:09 -0500
> Cc: 67533@debbugs.gnu.org
> 
> > On Nov 30, 2023, at 12:32 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > 
> > Does the patch below fix the issue?  (It should fix the recipe you
> > posted, but you hinted that this is just the simplest way of seeing a
> > more general problem, so I wonder whether that more general problem is
> > also fixed.)
> 
> Thanks for looking into it.  As you surmised, this patch fixes only the demo case with truncate-lines.  For the more general case, originally discovered with visual-line-mode on an org-mode file with many SVG preview overlays, the issue remains.  In that more general case, window-text-pixel-size sometimes gives 0 or (when the image is not at the start of the visual line) a value which is too large.  
> 
> The file I can pretty readily reproduce it on here is at https://gist.github.com/jdtsmith/de34aac901fc9f96f1a88a1b1b67d46e (I use dvigms for latex preview).  Only some of the preview overlay images (and other locations) exhibit the misbehavior, but more so for narrower frames with more wrapping.  I’m happy to test on this end, since my pixel scrolling code finds these types of incorrect results quite instantly.  As I change the window width and the text reflows, different positions exhibit the problems. 
> 
> The misbehavior extends to other regular text on the line, too, not just images.  There are various possibilities for what (window-text-pixel-size nil (cons (point) -1) (point) nil nil nil t) returns:
> 
> The correct value for position (start of line above) and (line-pixel-height) of that line.  Most text does this, but not when the visual line starts with a “bad” image.
> Images at line start can (but don’t always) return their own position and zero height.
> On an image further right of a line-starting “bad” image, it returns the bad image position, but the full height of the line. 
> Some images on lines which do not start with an image return the correct position (on the prior line), but a height which is too large, as if they included some of their own height in the total.

Thanks, but I need recipes I could reproduce on my system, and
reproduce relatively easily.  Debugging this usually takes numerous
runs under GDB, so the recipe should be reasonably easy to run, so it
doesn't take too long to set up a debugging session, and preferably it
should not require installation of optional packages.  It also cannot
depend on something that doesn't work on MS-Windows, because this is
the only system where I can debug a GUI Emacs.  So, for example, using
LaTeX Preview and dvigsm is out of the question; I need ready image
files prepared by LaTeX Preview and Lisp code to display them in a way
that causes problems.

So please try to provide recipes for the problems you still see, after
applying the patch I sent, as simple and preferably stand-alone Lisp
programs that don't require to install and run all of your code.  If
necessary, please emulate what your package does with simplified Lisp
code that just inserts text with display properties and overlays, to
produce the same result as the package does.

I'm sorry to insist on this and asking you to do extra work, but IME
this is the only way I can debug these issues efficiently enough to
solve them.  I appreciate the offer to test on your end, but such
testing is only useful when I have a tentative solution in hand for
you to test.  Such a tentative solution must be based on some problem
I found and fixed here, and for that I must be able to step through
the offending code in GDB.

Thanks.





  reply	other threads:[~2023-12-01  7:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 19:02 SVG images confound position pixel measurements JD Smith
2023-11-29 20:31 ` bug#67533: " JD Smith
2023-11-30 17:32   ` Eli Zaretskii
2023-11-30 21:00     ` JD Smith
2023-12-01  7:08       ` Eli Zaretskii [this message]
2023-12-01 22:04         ` JD Smith
2023-12-02  7:30           ` Eli Zaretskii
2023-12-02 13:36             ` JD Smith
2023-12-02 14:18               ` Eli Zaretskii
2023-12-02 19:39                 ` Eli Zaretskii
2023-12-02 21:44                   ` JD Smith
2023-12-03  3:04                     ` JD Smith
2023-12-03 13:02                       ` Eli Zaretskii
2023-12-03 15:48                         ` JD Smith
2023-12-03 15:52                           ` Eli Zaretskii
2023-12-03 16:31                             ` Eli Zaretskii
2023-12-03 21:25                               ` JD Smith
2023-12-03 23:14                                 ` JD Smith
2023-12-04  3:27                                 ` Eli Zaretskii
2023-12-04  4:32                                   ` JD Smith
2023-12-04 13:11                                     ` Eli Zaretskii
2023-12-04 14:14                                       ` JD Smith
2023-12-16  9:32                                         ` Eli Zaretskii
2023-12-16 15:07                                           ` JD Smith
2023-12-16 15:23                                             ` Eli Zaretskii
2023-12-03 15:49                         ` JD Smith
2023-12-03 16:33                           ` Eli Zaretskii
2023-12-03 18:58                             ` JD Smith
2023-12-01 14:40     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-01 14:55       ` Eli Zaretskii
2023-12-01 15:21         ` JD Smith
2023-12-01 15:36           ` Eli Zaretskii
2023-12-01 15:45             ` JD Smith
2023-12-01 15:59               ` Eli Zaretskii
2023-12-01 16:17                 ` JD Smith
2023-12-01 16:30                   ` Eli Zaretskii
2023-12-01 16:27         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-01 16:31           ` Eli Zaretskii
2023-12-01  8:36 ` Manuel Giraud via Emacs development discussions.
2023-12-01 14:11   ` JD Smith

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

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

  git send-email \
    --in-reply-to=837clybds3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=67533@debbugs.gnu.org \
    --cc=jdtsmith@gmail.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.