From: dalanicolai <dalanicolai@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 54688@debbugs.gnu.org
Subject: bug#54688: 29.0.50; Sliced image in margin looks bad
Date: Sun, 3 Apr 2022 13:03:27 +0200 [thread overview]
Message-ID: <CACJP=3nMwwxjjhC1WCuqeXLVAR7c9=0ntqm-uRfAw5+CL_TzjQ@mail.gmail.com> (raw)
In-Reply-To: <83v8vq30aa.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2112 bytes --]
(Once more using reply-all)
Playing around with :ascent, makes possible to keep the line-pixel-height
fixed.
So in the following I simply use `insert-image`. Without the :ascent, the
'line-pixel-height' increases when inserting another character. With the
:ascent it is possible to reduce this 'increase'. For me the increase is 0
when I use an ascent value of 80.
(below the used code)
(with-current-buffer (get-buffer-create "test")
(setq left-margin-width 5)
(insert-image (svg-image (let* ((ph (line-pixel-height))
(size ph)
(svg (svg-create size size)))
(svg-circle svg ph ph ph :fill "red")
svg)
:ascent 80))
(switch-to-buffer (current-buffer)))
On Sun, 3 Apr 2022 at 12:54, Eli Zaretskii <eliz@gnu.org> wrote:
> > From: dalanicolai <dalanicolai@gmail.com>
> > Date: Sun, 3 Apr 2022 12:33:01 +0200
> > Cc: 54688@debbugs.gnu.org
> >
> > Thank you for the quick reply. However, the height of the image,
> > (* 2 (line-pixel-height)), is equal to twice the `default-font-height`
> > (the 'line-pixel-height' and 'default-font-height' are equal, here both
> > 17).
> >
> > So before I add the character after the image, (line-pixel-height)
> > returns 17. But when I insert a character after it (with
> > 'default-font-height' is 17), the `line-pixel-height` increases to
> > 22. So I am not sure how to not let the line height increase.
> > I will try to play a little with the :ascent value.
>
> Images can also have margins:
>
> int
> image_ascent (struct image *img, struct face *face, struct glyph_slice
> *slice)
> {
> int height;
> int ascent;
>
> if (slice->height == img->height)
> height = img->height + img->vmargin;
> else if (slice->y == 0)
> height = slice->height + img->vmargin;
> else
> height = slice->height;
>
> Maybe those make the difference?
>
> In any case, once I add a character, the line height grows, which
> tells us some vertical dimension somewhere is unaccounted for.
>
[-- Attachment #2: Type: text/html, Size: 3060 bytes --]
next prev parent reply other threads:[~2022-04-03 11:03 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
2022-04-03 10:33 ` dalanicolai
2022-04-03 10:54 ` Eli Zaretskii
2022-04-03 11:03 ` dalanicolai [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACJP=3nMwwxjjhC1WCuqeXLVAR7c9=0ntqm-uRfAw5+CL_TzjQ@mail.gmail.com' \
--to=dalanicolai@gmail.com \
--cc=54688@debbugs.gnu.org \
--cc=eliz@gnu.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 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.