all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: ynyaaa@gmail.com
Cc: 46464@debbugs.gnu.org
Subject: bug#46464: 27.1; wide images are hidden partially at the right edge of window
Date: Mon, 15 Feb 2021 17:41:15 +0200	[thread overview]
Message-ID: <83o8gl9w4k.fsf@gnu.org> (raw)
In-Reply-To: <86pn11fnyv.fsf@gmail.com> (ynyaaa@gmail.com)

> From: ynyaaa@gmail.com
> Cc: 46464@debbugs.gnu.org
> Date: Mon, 15 Feb 2021 22:40:56 +0900
> 
> >> If a edge of a image is near the right edge of the window,
> >> the image is mostly hidden. It is not preferable.
> >
> > That's how Emacs behaved since v21.
> 
> If the width of the iamge is 200 pixels, typing some characters at the
> beginning of the same line, the image moves to the right and gets hidden
> gradually and is wrapped to the next visual line.
> 
> If the width of the image is 150 pixels, the entire image does not get
> hidden and it is wrapped when the image right edge is going to across
> the right edge of the window.
> 
> What is the difference?

There's a heuristic that changes behavior when the image becomes
wider than 1/4 of the window.  By default, the "emacs -Q" window is
640 pixels wide, so that's what you see.

> >> And if :margin is specified, the image may be hidden completely.
> >> 
> >> By the way, if :margin is specified, a partial image on the right edge
> >> of the window is displayed with right margin.
> >
> > I don't think I understand what you mean by that.  Can you show a test
> > case?
> 
> Evaluating the form below, four images are supposed to be displayed in
> the first visual line. But the fourth image is invisible. Similar for
> the second visual line.
> 
> If ':margin 5' is replaced with ':margin 20', three images are displayed
> in the first to third visual lines. Third image in each visual line is
> truncated at the x-coordinate 20 pixels apart from the right edge of the
> window. It looks as if the image is not truncated and is small.
> 
> (dotimes (i 10)
>   (let* ((w 200) (h 30) (sw 6)
>          (color (nth (% i 5) '("red" "green" "blue" "yellow" "orange")))
>          (svg (format "<svg width=\"%g\" height=\"%g\"
>  version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">
> <rect x=\"%g\" y=\"%g\" width=\"%g\" height=\"%g\" stroke=\"%s\"
>  stroke-width=\"%g\" fill=\"grey\"/>
> </svg>" w h (/ sw 2) (/ sw 2) (- w sw) (- h sw) color sw)))
>     (insert-image (create-image svg 'svg t :margin 5 :scale 1))))

I will look into this and see if this is a bug or intended behavior.

In general, Lisp programs that display wide images should be careful
about these aspects to make sure images aren't clipped and appear in
their entirety.





  reply	other threads:[~2021-02-15 15:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-12 15:11 bug#46464: 27.1; wide images are hidden partially at the right edge of window ynyaaa
2021-02-13 13:01 ` Eli Zaretskii
2021-02-14 14:30   ` ynyaaa
2021-02-14 16:10     ` Eli Zaretskii
2021-02-15 13:40       ` ynyaaa
2021-02-15 15:41         ` Eli Zaretskii [this message]
2021-02-16 18:56           ` 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

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

  git send-email \
    --in-reply-to=83o8gl9w4k.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=46464@debbugs.gnu.org \
    --cc=ynyaaa@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.