unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Joseph Turner 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: 69972@debbugs.gnu.org
Subject: bug#69972: 29.1; Unexpected behavior when scrolling images
Date: Mon, 25 Mar 2024 12:43:39 -0700	[thread overview]
Message-ID: <87h6grl4ky.fsf@ushin.org> (raw)
In-Reply-To: <86plvijy9r.fsf@gnu.org>


Eli Zaretskii <eliz@gnu.org> writes:

>> From: Joseph Turner <joseph@ushin.org>
>> Cc: 69972@debbugs.gnu.org
>> Date: Sun, 24 Mar 2024 18:06:44 -0700
>>
>> 1. "M-: (scroll-up) RET" (repeatedly)
>> 2. C-v (repeatedly)
>> 3. <wheel-down> (repeatedly)
>>
>> With all three methods, at first Emacs gradually scrolls the image, but
>> then when I reach the bottom of the image, the image disappears entirely
>> as Emacs scrolls past it all at once.
>
> Why is that a problem?  The default Emacs scrolling commands don't
> guarantee smooth constant-rate scrolling, they guarantee only that you
> get to see all the portions of the image, without missing any.  So
> when you get to the end of the image, there's a heuristic that decides
> whether we can scroll past the image, and that is what you see.
>
> I see no bug here.

With pixel-scroll-precision-mode enabled and at least one character after
the image, I am able to smoothly scroll around the image.

(with-current-buffer (get-buffer-create "*test-scroll-image*")
  (erase-buffer)
  (insert-image (create-image "splash.png" nil nil :scale 10))
  (insert " ") ;; There must be some text after the image
  (goto-char (point-min))
  (pixel-scroll-precision-mode 1)
  (pop-to-buffer (current-buffer)))

However, if the window is scrolled to the right, then it is impossible
to scroll down:

(with-current-buffer (get-buffer-create "*test-scroll-image*")
  (erase-buffer)
  (insert-image (create-image "splash.png" nil nil :scale 10))
  (insert-char 8203)
  (goto-char (point-min))
  (pixel-scroll-precision-mode 1)
  (pop-to-buffer (current-buffer))
  (set-window-hscroll (get-buffer-window) 1)) ;; Image scrolled to right

In this buffer, if I attempt to scroll down with the mouse wheel, I
immediately get "End of buffer" error and the image does not move.

Thank you!

Joseph





  reply	other threads:[~2024-03-25 19:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-24  9:07 bug#69972: 29.1; Unexpected behavior when scrolling images Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-24  9:42 ` Eli Zaretskii
2024-03-25  1:06   ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-25  8:34     ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-25 12:23     ` Eli Zaretskii
2024-03-25 19:43       ` Joseph Turner via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-03-28  6:24         ` Eli Zaretskii
2024-03-28 11:12           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=87h6grl4ky.fsf@ushin.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69972@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=joseph@ushin.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).