unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Manuel Giraud <manuel@ledu-giraud.fr>
To: Eli Zaretskii <eliz@gnu.org>
Cc: stephen.berman@gmx.net, 59802@debbugs.gnu.org
Subject: bug#59802: 30.0.50; Checkbox button not rendered
Date: Tue, 13 Dec 2022 18:15:56 +0100	[thread overview]
Message-ID: <87tu1zb4xf.fsf@ledu-giraud.fr> (raw)
In-Reply-To: <83v8mfntnw.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 13 Dec 2022 18:40:51 +0200")

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

Eli Zaretskii <eliz@gnu.org> 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?

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-SVG-scaling-bug-59802.patch --]
[-- Type: text/x-patch, Size: 1294 bytes --]

From 73d58b9d631dce8d84965cb842f3a831c24187af Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel@ledu-giraud.fr>
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


[-- Attachment #3: Type: text/plain, Size: 18 bytes --]

-- 
Manuel Giraud

  reply	other threads:[~2022-12-13 17:15 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-03 10:40 bug#59802: 30.0.50; Checkbox button not rendered Manuel Giraud
2022-12-03 11:29 ` Eli Zaretskii
2022-12-03 14:47   ` Manuel Giraud
2022-12-03 17:44     ` Eli Zaretskii
2022-12-03 18:16       ` Manuel Giraud
2022-12-03 18:22         ` Eli Zaretskii
2022-12-03 18:24       ` Manuel Giraud
2022-12-03 18:49         ` Eli Zaretskii
2022-12-03 21:32           ` Manuel Giraud
2022-12-04  7:02             ` Eli Zaretskii
2022-12-09 12:26               ` Manuel Giraud
2022-12-09 12:35                 ` Eli Zaretskii
2022-12-09 13:41                   ` Stephen Berman
2022-12-09 14:07                     ` Manuel Giraud
2022-12-09 14:14                       ` Stephen Berman
2022-12-10 13:49                     ` Eli Zaretskii
2022-12-10 16:24                       ` Stephen Berman
2022-12-10 17:04                         ` Eli Zaretskii
2022-12-10 17:57                           ` Manuel Giraud
2022-12-10 18:38                             ` Eli Zaretskii
2022-12-11 13:12                           ` Stephen Berman
2022-12-11 14:47                             ` Eli Zaretskii
2022-12-11 15:54                             ` Eli Zaretskii
2022-12-11 22:40                               ` Stephen Berman
2022-12-12 17:42                                 ` Eli Zaretskii
2022-12-12 23:38                                   ` Stephen Berman
2022-12-12 12:33                               ` Manuel Giraud
2022-12-12 16:56                               ` Manuel Giraud
2022-12-12 17:25                                 ` Stephen Berman
2022-12-12 17:38                                 ` Eli Zaretskii
2022-12-13  9:21                                   ` Manuel Giraud
2022-12-13 10:16                                     ` Stephen Berman
2022-12-13 12:49                                     ` Eli Zaretskii
2022-12-13 16:16                                       ` Manuel Giraud
2022-12-13 16:40                                         ` Eli Zaretskii
2022-12-13 17:15                                           ` Manuel Giraud [this message]
2022-12-13 17:36                                             ` Eli Zaretskii
2022-12-16  8:27                                               ` Manuel Giraud
2022-12-16 15:51                                                 ` Eli Zaretskii
2022-12-16 16:09                                                   ` Manuel Giraud
2022-12-09 13:57                   ` Manuel Giraud
2022-12-10 13:47                     ` Eli Zaretskii
2022-12-10 14:26                       ` Manuel Giraud

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tu1zb4xf.fsf@ledu-giraud.fr \
    --to=manuel@ledu-giraud.fr \
    --cc=59802@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).