emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hollow cursor under images


From: Alan Third
Subject: Re: Hollow cursor under images
Date: Mon, 4 Mar 2019 22:36:05 +0000
User-agent: Mutt/1.11.3 (2019-02-01)

On Mon, Mar 04, 2019 at 11:04:10PM +0300, Evgeny Zajcev wrote:
> 
> I have text property `face' attached to the region which image occupies,
> consider:
> 
> (let ((svg (svg-create (frame-char-width) (* 2 (frame-char-height)))))
>   (svg-circle svg 10 10 10 :fill-color "red")
>   (insert (propertize "X" 'face 'region
>                       'display (list '(slice 0.0 0.0 1.0 0.5)
>                                      (svg-image svg :scale 1.0
>                                                 :ascent 'center
>                                                 :mask 'heuristic)))))
> 
> Background of the image gets color from `region' face, but when the cursor
> is under the image it gets hollow type and still background of `region'
> face is visible.
> 
> I just realized, that if I create image that fits into single char, such as:
> 
> (let ((svg (svg-create (frame-char-width) (frame-char-height))))
>   (svg-circle svg 10 10 10 :fill-color "red")
>   (insert (propertize "X" 'face 'region
>                       'display (svg-image svg :scale 1.0
>                                           :ascent 'center
>                                           :mask 'heuristic))))
> 
> Then cursor behaves as expected initially!  It does not get hollow type and
> background gets cursor color.  I expected the same for images that do not
> fit into single char

I can confirm this happens on X. I can see it in a build from 2017, so
it’s not been caused by my image resizing code, which was my initial
thought.

The key image dimension appears to be 32 pixels. At 32 and below the
cursor shows through the background colour. At 33 and above, the
background remains white and the cursor appears as a box round the
image.

So a 32x32 image shows the cursor, a 33x32 or 32x33 image doesn’t.

I can’t see what makes 32 special. 
-- 
Alan Third



reply via email to

[Prev in Thread] Current Thread [Next in Thread]