bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#40845: SVG rendering issues


From: Alan Third
Subject: bug#40845: SVG rendering issues
Date: Sun, 3 May 2020 19:38:39 +0100

On Sun, May 03, 2020 at 07:49:45PM +0300, Eli Zaretskii wrote:
> > Date: Sun, 3 May 2020 17:24:17 +0100
> > From: Alan Third <alan@idiocy.org>
> > Cc: cpitclaudel@gmail.com, 40845@debbugs.gnu.org, pipcet@gmail.com
> > 
> > One thing is that it gets the foreground colour from the default face
> > instead of the current face. I’m not sure how to solve that.
> 
> Can you describe the difficulty in using the current face?

I’m mostly unsure how I access it. I don’t think images or image.c
have any real concept of where they are in the buffer.

I think we’d also have to recreate the image any time the face
changed. For example in Clement’s test code from the original bug
report, he has the face changing when the mouse hovers over the text.
In order to handle that case we would need to create a new version of
the image with the updated foreground and background when the mouse
moves over it.

We can work around having to update the background by using proper
transparency, but I don’t know what other problems that might
introduce. It’s harder for the foreground. Pip Cet suggested creating
masks for foreground and background and using them to draw the image
in sections, but I feel that’s perhaps getting a little complex,
especially when I think most images won’t be changing their foreground
and background colours.

I feel it would be easier just to have two or more cached images with
different foreground and backgrounds as required.

> > I’m unsure if my use of malloc is OK, as I know Emacs code uses some
> > different methods in different places.
> 
> It's okay to call malloc and free in image.c.

Excellent, thanks.
-- 
Alan Third





reply via email to

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