unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: dalanicolai <dalanicolai@gmail.com>
Cc: 54688@debbugs.gnu.org
Subject: bug#54688: 29.0.50; Sliced image in margin looks bad
Date: Sun, 03 Apr 2022 11:57:04 +0300	[thread overview]
Message-ID: <83zgl235pb.fsf@gnu.org> (raw)
In-Reply-To: <CACJP=3=U8oFrS8Gk8+nfCNrm+Avp_irXnrwZix5gra6Xn=3j+A@mail.gmail.com> (message from dalanicolai on Sun, 3 Apr 2022 08:50:20 +0200)

> From: dalanicolai <dalanicolai@gmail.com>
> Date: Sun, 3 Apr 2022 08:50:20 +0200
> 
> Passing 'left-margin' for the AREA parameter in `insert-sliced-image`
> results in bad looking image. To reproduce from `emacs -q` evaluate the
> following code example:
> 
> (with-current-buffer (get-buffer-create "test")
>   (setq left-margin-width 5)
>   (insert-sliced-image (svg-image (let* ((ph (line-pixel-height))
>                                          (size (* 2 ph))
>                                          (svg (svg-create size size)))
>                                     (svg-circle svg ph ph ph :fill "red")
>                                     svg))
>                        nil
>                        'left-margin
>                        2)
>   (switch-to-buffer (current-buffer)))
> 
> when instead of 'left-margin', nil is passed as value (i.e. the text is
> inserted in the text area), then everything looks fine.

"Everything looks fine" until you insert some text after the 2 slices
of the image.  That is, after evaluating the form with left-margin
replaced by nil, do this:

  C-u 2 M-g c  ;; go to buffer position 2
  x            ;; insert a character
  C-n          ;; go to next line
  x            ;; insert another character

The problem is that your images are smaller than the default height of
the screen line, as determined by the 'default' face.  So slices of
the image do not produce a single circle, but two semi-circles with
empty space between them.

If this is the problem, then I see nothing wrong with this: to have
the two slices come together, you need to fit the size of the image to
the height of the default face.





  reply	other threads:[~2022-04-03  8:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-03  6:50 bug#54688: 29.0.50; Sliced image in margin looks bad dalanicolai
2022-04-03  8:57 ` Eli Zaretskii [this message]
2022-04-03 10:33   ` dalanicolai
2022-04-03 10:54     ` Eli Zaretskii
2022-04-03 11:03       ` dalanicolai
2022-04-03 11:04         ` dalanicolai
2022-04-03 12:02           ` Eli Zaretskii
2022-04-03 12:03         ` Eli Zaretskii
2022-04-03 13:05           ` dalanicolai
2022-04-03 13:09             ` dalanicolai

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=83zgl235pb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=54688@debbugs.gnu.org \
    --cc=dalanicolai@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 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).