From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.bugs Subject: bug#59802: 30.0.50; Checkbox button not rendered Date: Tue, 13 Dec 2022 18:15:56 +0100 Message-ID: <87tu1zb4xf.fsf@ledu-giraud.fr> References: <87v8mshit6.fsf@ledu-giraud.fr> <87r0xgh7c3.fsf@ledu-giraud.fr> <83zgc4crg6.fsf@gnu.org> <87ilisgxbi.fsf@ledu-giraud.fr> <83lenocoge.fsf@gnu.org> <87edtggol3.fsf@ledu-giraud.fr> <83359vd535.fsf@gnu.org> <87cz8s3gq7.fsf@ledu-giraud.fr> <83sfhozreh.fsf@gnu.org> <87ilik8zjs.fsf@gmx.net> <83v8mjweqm.fsf@gnu.org> <87h6y3447l.fsf@gmx.net> <83cz8rw5pq.fsf@gnu.org> <874ju2qe3a.fsf@gmx.net> <83k02yszqf.fsf@gnu.org> <87k02wd0hl.fsf@ledu-giraud.fr> <83lencr08t.fsf@gnu.org> <87fsdjd5g4.fsf@ledu-giraud.fr> <83k02vpixs.fsf@gnu.org> <87zgbrb7oj.fsf@ledu-giraud.fr> <83v8mfntnw.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5235"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: stephen.berman@gmx.net, 59802@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 13 18:18:13 2022 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 1p58uy-00016I-7j for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Dec 2022 18:18:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p58uh-00045r-W9; Tue, 13 Dec 2022 12:17:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p58u1-00042e-Bs for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 12:17:48 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p58tq-0001q5-QW for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 12:17:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p58tq-0006Zr-Bb for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 12:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2022 17:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59802 X-GNU-PR-Package: emacs Original-Received: via spool by 59802-submit@debbugs.gnu.org id=B59802.167095176425266 (code B ref 59802); Tue, 13 Dec 2022 17:17:02 +0000 Original-Received: (at 59802) by debbugs.gnu.org; 13 Dec 2022 17:16:04 +0000 Original-Received: from localhost ([127.0.0.1]:33437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p58st-0006ZS-Q8 for submit@debbugs.gnu.org; Tue, 13 Dec 2022 12:16:04 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:21556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p58sr-0006Yy-40 for 59802@debbugs.gnu.org; Tue, 13 Dec 2022 12:16:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=EHoIKTDxmtgJFlFO WlT6TWQxyaUYyG3oroMza3I8gGE=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=saBrBg821FHutPE7FqIlU3N6gwGqdw11XjihA3 EmFKktxGjok1tD1FEGthbwdyQVdbkUwIUcbcLG7clwYeElUNRGUqG/W8zb/e6Um+ewyqmi ns4J5hahmatKNBW72z9K222RdOjYCYLwyVNSdMi/KJXgKnEhKLkT+GnQXu49hCtg5ztg0r VH0QlG9dYWRVP8IqEtC8eAGRYrzhdCUx2JiGR6Z685/p6qjafk0rX8crI3KBYFV6aDvM92 XGIWyWqzO5/1cpSlk8OzAU+gIssvAHzSLsm33ABSLI09gm/+F9Y06gG0b0ut+3DSLWWH1t n4gWva/8SdcvrcqVRfg3/cqA== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id e2578819 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 13 Dec 2022 18:15:58 +0100 (CET) In-Reply-To: <83v8mfntnw.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 13 Dec 2022 18:40:51 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250859 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: [...] > Perhaps this means you need to reshuffle the code so that the case > where both dimensions are non-zero comes the first. Then you will > have fewer negations in the conditions and the code will be easier to > read and understand. You're right. What do you think of this? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-SVG-scaling-bug-59802.patch >From 73d58b9d631dce8d84965cb842f3a831c24187af Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Tue, 13 Dec 2022 10:10:03 +0100 Subject: [PATCH] Fix SVG scaling (bug#59802) Fix SVG scaling with librsvg>2.52 and SVG file with only one known dimension. * src/image.c (svg_load_image): Compute a percentage dimension with the other known dimension. --- src/image.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/image.c b/src/image.c index 2436f78ac3..b881e43e95 100644 --- a/src/image.c +++ b/src/image.c @@ -11309,6 +11309,15 @@ svg_load_image (struct frame *f, struct image *img, char *contents, img->face_font_size); viewbox_height = svg_css_length_to_pixels (iheight, dpi, img->face_font_size); + + /* Here one dimension could be zero because in percent unit. + So calculate this dimension with the other. */ + if (! (0 < viewbox_width) && (iwidth.unit == RSVG_UNIT_PERCENT)) + viewbox_width = (viewbox_height * viewbox.width / viewbox.height) + * iwidth.length; + else if (! (0 < viewbox_height) && (iheight.unit == RSVG_UNIT_PERCENT)) + viewbox_height = (viewbox_width * viewbox.height / viewbox.width) + * iheight.length; } else if (has_width && has_viewbox) { -- 2.38.1 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--