From 70864205f1595815470639cd2ad47c5465206f03 Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Thu, 12 Jan 2023 12:03:49 +0530 Subject: [PATCH] Use internal image scaling when using SVG images in doc-view * lisp/doc-view.el (doc-view-enlarge, doc-view-scale-reset): Default to changing the :width image property when using SVG images even if doc-view-scaling-internally is nil. (doc-view--image-type): Document the new possible image type. (bug#58041) --- lisp/doc-view.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 7c272f52fb..cdca17f5af 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -489,7 +489,7 @@ doc-view-single-page-converter-function (defvar-local doc-view--image-type nil "The type of image in the current buffer. -Can be `png' or `tiff'.") +Can be `png', `svg', or `tiff'.") (defvar-local doc-view--image-file-pattern nil "The `format' pattern of image file names. @@ -921,7 +921,9 @@ doc-view-shrink-factor (defun doc-view-enlarge (factor) "Enlarge the document by FACTOR." (interactive (list doc-view-shrink-factor)) - (if doc-view-scale-internally + (if (or doc-view-scale-internally + (and (eq doc-view--image-type 'svg) + doc-view-mupdf-use-svg)) (let ((new (ceiling (* factor doc-view-image-width)))) (unless (equal new doc-view-image-width) (setq-local doc-view-image-width new) @@ -941,7 +943,9 @@ doc-view-shrink (defun doc-view-scale-reset () "Reset the document size/zoom level to the initial one." (interactive) - (if doc-view-scale-internally + (if (or doc-view-scale-internally + (and (eq doc-view--image-type 'svg) + doc-view-mupdf-use-svg)) (progn (kill-local-variable 'doc-view-image-width) (doc-view-insert-image -- 2.38.1