From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Third Newsgroups: gmane.emacs.bugs Subject: bug#40845: SVG rendering issues Date: Sat, 22 Aug 2020 23:35:46 +0200 (CEST) Message-ID: <20200822213543.GD89421@breton.holly.idiocy.org> References: <83r1w1ovc3.fsf@gnu.org> <20200509142727.GA42881@breton.holly.idiocy.org> <20200509195415.GA44624@breton.holly.idiocy.org> <835zcx314r.fsf@gnu.org> <20200515214047.GB55337@breton.holly.idiocy.org> <20200822161510.GB89421@breton.holly.idiocy.org> <835z9aaaef.fsf@gnu.org> <20200822185756.GC89421@breton.holly.idiocy.org> <83y2m68p7i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19250"; mail-complaints-to="usenet@ciao.gmane.io" Cc: cpitclaudel@gmail.com, 40845@debbugs.gnu.org, pipcet@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 22 23:36:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k9bBM-0004pr-GL for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Aug 2020 23:36:12 +0200 Original-Received: from localhost ([::1]:44684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k9bBL-00065A-It for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Aug 2020 17:36:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9bBE-00064t-4Q for bug-gnu-emacs@gnu.org; Sat, 22 Aug 2020 17:36:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k9bBC-0004gf-S5 for bug-gnu-emacs@gnu.org; Sat, 22 Aug 2020 17:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k9bBB-00031c-Oo for bug-gnu-emacs@gnu.org; Sat, 22 Aug 2020 17:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Third Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Aug 2020 21:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40845 X-GNU-PR-Package: emacs Original-Received: via spool by 40845-submit@debbugs.gnu.org id=B40845.159813215811607 (code B ref 40845); Sat, 22 Aug 2020 21:36:01 +0000 Original-Received: (at 40845) by debbugs.gnu.org; 22 Aug 2020 21:35:58 +0000 Original-Received: from localhost ([127.0.0.1]:51630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9bB7-000319-OO for submit@debbugs.gnu.org; Sat, 22 Aug 2020 17:35:57 -0400 Original-Received: from mailout-l3b-97.contactoffice.com ([212.3.242.97]:50092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9bB5-00030n-Cq for 40845@debbugs.gnu.org; Sat, 22 Aug 2020 17:35:56 -0400 Original-Received: from smtpauth2.co-bxl (smtpauth2.co-bxl [10.2.0.24]) by mailout-l3b-97.contactoffice.com (Postfix) with ESMTP id 09A161D53; Sat, 22 Aug 2020 23:35:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1598132149; s=20200222-6h9o; d=idiocy.org; i=alan@idiocy.org; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:In-Reply-To; l=2028; bh=0fPzOXlB3kL0v4GkidEJXn36kLve40wW3pejnKke5JU=; b=vRtoNihCJ/K5eJCB/OUGjiYAXn3GlUwloz5ru4PUmc6TiI0s1cWJpwNrJA7y9STd 0+XoWDnKIB+cBFaXSy1j8+Q2o/FPL6W58wE9GCS3nFEy2ExTZLW3wtP1OzY5uMMlmMw Okt4zaaQbkTqHwVmxkhhjrqs17FNIzqVT4618trQy+wXzXEEVgf2TTUpn/kiXqujxOJ TPQ9yzolybqfrH6Uilhjk6CZYwm0kt7jrQzCnehp86tXPg/OnuRTgz09Oq285wGw/Ix ZcxHIgZd7ooJNW3V6FgoYL4oktLQT3TR+hD1LWNXZtcFT3gydo2Lu0J7SVAX08VlG3n D93arj94qg== Original-Received: by smtp.mailfence.com with ESMTPA ; Sat, 22 Aug 2020 23:35:44 +0200 (CEST) Original-Received: by breton.holly.idiocy.org (Postfix, from userid 501) id 455B22024C79CE; Sat, 22 Aug 2020 22:35:43 +0100 (BST) Mail-Followup-To: Alan Third , Eli Zaretskii , cpitclaudel@gmail.com, 40845@debbugs.gnu.org, pipcet@gmail.com Content-Disposition: inline In-Reply-To: <83y2m68p7i.fsf@gnu.org> X-ContactOffice-Account: com:241649512 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186005 Archived-At: On Sat, Aug 22, 2020 at 10:17:53PM +0300, Eli Zaretskii wrote: > > Date: Sat, 22 Aug 2020 20:57:59 +0200 (CEST) > > From: Alan Third > > Cc: cpitclaudel@gmail.com, 40845@debbugs.gnu.org, pipcet@gmail.com > > > > Basically, if you try Clement's original example, when you move the > > mouse over the image the background colour doesn't change to match the > > rest of the line. > > > > I'm picking up the background colour from the face stored in "it" in > > push_prefix_prop or handle_single_display_spec in xdisp.c. As far as I > > can tell one or both of these are the only places we can define the > > image with the face colours as this is where we actually load the > > image. The problem is that I don't see any way to work out if the > > current image should use the background colour from the mouse face. > > > > I know that later on we can do (s->hl == DRAW_MOUSE_FACE), but I don't > > think those structures are built yet? > > I think you want to modify note_mouse_highlight so that it sets up the > frame's mouse-highlight info for image glyphs, like it currently does > for character glyphs. It's possible this is all that needs to be > done; if not, we should see how to change show_mouse_face and its > subroutines to display images with mouse-highlight. > > Let me know if you need more guidance. Thanks for your help, and that certainly helped me understand a bit more about how mouse highlighting works and I don't think setting the background colour from a face is a practical way of doing this. But I've just realised we don't need to do it. Masks provide this functionality. If you want the background of your SVG to match the background of the buffer, use a mask, which can be keyed off a specific colour or whatever. Unfortunately it won't work well for semi-transparent images, but I think the only really practical solution for that is to introduce proper transparency handling. Therefore I think this patch is ready to go. -- Alan Third