Subject: Re: bug#77429: 31.0.50; Image map and display slice on mode/header/tab line

From: Eli Zaretskii <[email-masked]>
Date: Tue, 01 Apr 2025 18:43:08 +0300

> Date: Tue, 1 Apr 2025 15:06:49 +0200
> From:  David Ponce via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> (require 'svg)
> (let* ((w 304)
>         (h (frame-char-height))
>         (svg (svg-create w h)))
>    (svg-rectangle svg 0   0 100 h :fill "red")
>    (svg-rectangle svg 102 0 100 h :fill "green")
>    (svg-rectangle svg 204 0 100 h :fill "blue")
>    (let* ((img (svg-image svg :scale 1
>                           :map
>                           `(
>                             ((rect . ((0   . 0) . (100 . ,h)))
>                              r (help-echo "RED"   pointer hand))
>                             ((rect . ((102 . 0) . (202 . ,h)))
>                              g (help-echo "GREEN" pointer hand))
>                             ((rect . ((204 . 0) . (304 . ,h)))
>                              b (help-echo "BLUE"  pointer hand))
>                             )))
>           (full (propertize " " 'display img))
>           (cut  (propertize " " 'display `((slice 102 0 202 1.0) ,img)))
>           (both (concat cut " " full)))
>      (setq header-line-format both)
>      (insert both "\n")))
> 
> I'm reporting this inconsistency, at least to find out if it's a real
> bug or a limitation that needs to be addressed by the programmer.

Bug.  And a very old one.  Should be fixed now on the master branch;
please test.