all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#67604: Motion problems with inline images
@ 2023-12-03 16:54 JD Smith
  2023-12-03 17:11 ` Eli Zaretskii
  0 siblings, 1 reply; 23+ messages in thread
From: JD Smith @ 2023-12-03 16:54 UTC (permalink / raw)
  To: 67604

[-- Attachment #1: Type: text/plain, Size: 1960 bytes --]

Following on from the recently fixed bug#67533, which related to incorrect pixel size measurements with inline images, one remaining issue, with that fix in place, relates to motion in buffers in visual line mode with inline images.  A video of the effect <https://gist.github.com/jdtsmith/ad765047a6afe20f353de573d8c07da9?permalink_comment_id=4780726#gistcomment-4780726> can be seen on the associated gist for bug#67533.

Here the issue is that next-line/forward-line/(vertical-motion 1) all skip from the Green inline SVG straight to the “JUMPS HERE” line, for certain frame widths (for me: 79 characters).  See reproduction code, below.  Depending on your font char size (mine is 7x14 pixels) this width may vary for you.  Note that multiple frame width produce the exact same wrapped appearance, but the motion bug shows up only for one of them.

There are other related phenomena, such as prev-line from an image at column 0 jumping to (near the) end of the previous screen line, but hopefully this is enough to identify the motion issue(s) at hand.

++++ 
(require 'svg)
(let ((buf "svg-file-motion-demo")
      (ims '(("red" 146 29)
	     ("green" 106 29)
	     ("blue" 151 29))))
  (with-current-buffer (get-buffer-create buf)
    (erase-buffer)
    (visual-line-mode 1)
    (insert "tellus.  $\\gamma(t) = \\log\\left(\\sqrt{\\tan(t)}\\right)$  Donec hendrerit tempor tellus.  $\\chi(y) = \\sqrt{\\frac{1}{\\log(y)}}$  Phasellus lacus.  $\\tau(t) = \\exp\\left(\\sqrt{\\exp(t)}\\right)$  Curabitur lacinia pulvinar nibh.
JUMPS HERE")
    (goto-char (point-min))
    (while  (re-search-forward (rx ?$ (* (not ?$)) ?$) nil t)
      (let* ((ov (make-overlay (match-beginning 0) (match-end 0)))
	     (im (pop ims))
	     (svg (svg-create (nth 1 im) (nth 2 im))))
	(svg-rectangle svg 0 0 (nth 1 im) (nth 2 im) :fill-color (car im))
	(overlay-put ov 'display (svg-image svg :ascent 'center)))))
  (pop-to-buffer buf))
++++


[-- Attachment #2: Type: text/html, Size: 3252 bytes --]

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2024-09-03 18:00 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-03 16:54 bug#67604: Motion problems with inline images JD Smith
2023-12-03 17:11 ` Eli Zaretskii
2023-12-03 20:46   ` JD Smith
2023-12-04 13:16     ` Eli Zaretskii
2023-12-04 14:10       ` JD Smith
2023-12-04 14:17         ` Eli Zaretskii
2023-12-04 14:25           ` JD Smith
2023-12-04 14:37             ` Eli Zaretskii
2023-12-04 17:44               ` JD Smith
2023-12-04 18:20                 ` Eli Zaretskii
2023-12-04 19:16                   ` JD Smith
2023-12-04 19:38                     ` Eli Zaretskii
2023-12-04 21:05                       ` JD Smith
2023-12-05  3:24                         ` Eli Zaretskii
2023-12-05 23:06                           ` JD Smith
2023-12-06  3:31                             ` Eli Zaretskii
2023-12-06  4:33                               ` JD Smith
2023-12-06 12:25                                 ` Eli Zaretskii
2023-12-06 18:29                                   ` JD Smith
2023-12-11 19:06                               ` JD Smith
2023-12-11 19:44                                 ` Eli Zaretskii
2023-12-11 22:06                                   ` JD Smith
2024-09-03 18:00                                   ` JD Smith

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.