diff options
| author | Paul Eggert | 2021-12-03 09:47:22 -0800 |
|---|---|---|
| committer | Paul Eggert | 2021-12-03 10:25:09 -0800 |
| commit | 02386da9389104ca4d4dde875a3fdac36eb10555 (patch) | |
| tree | 8eb8ef0e956cc7595456549cf75ab43ed59d799c /src | |
| parent | 19ac237c9eeedebbf6bfb23e16d5f9f463e2d80a (diff) | |
| download | emacs-02386da9389104ca4d4dde875a3fdac36eb10555.tar.gz emacs-02386da9389104ca4d4dde875a3fdac36eb10555.zip | |
Simplify svg_load_image
* src/image.c (svg_load_image): Simplify slightly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/image.c b/src/image.c index f13304912c8..1db2b78ad5b 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -10469,14 +10469,12 @@ svg_load_image (struct frame *f, struct image *img, char *contents, | |||
| 10469 | else if (has_width && has_viewbox) | 10469 | else if (has_width && has_viewbox) |
| 10470 | { | 10470 | { |
| 10471 | viewbox_width = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size); | 10471 | viewbox_width = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size); |
| 10472 | viewbox_height = svg_css_length_to_pixels (iwidth, dpi, img->face_font_size) | 10472 | viewbox_height = viewbox_width * viewbox.height / viewbox.width; |
| 10473 | * viewbox.height / viewbox.width; | ||
| 10474 | } | 10473 | } |
| 10475 | else if (has_height && has_viewbox) | 10474 | else if (has_height && has_viewbox) |
| 10476 | { | 10475 | { |
| 10477 | viewbox_height = svg_css_length_to_pixels (iheight, dpi, img->face_font_size); | 10476 | viewbox_height = svg_css_length_to_pixels (iheight, dpi, img->face_font_size); |
| 10478 | viewbox_width = svg_css_length_to_pixels (iheight, dpi, img->face_font_size) | 10477 | viewbox_width = viewbox_height * viewbox.width / viewbox.height; |
| 10479 | * viewbox.width / viewbox.height; | ||
| 10480 | } | 10478 | } |
| 10481 | else if (has_viewbox) | 10479 | else if (has_viewbox) |
| 10482 | { | 10480 | { |