From 5ba738eb0a24e54852e3a5fb11894a3f39355b7e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 9 Nov 2021 05:55:32 +0100 Subject: [PATCH] Make image-compute-scaling-factor argument optional * lisp/image.el (image-compute-scaling-factor): Make the argument optional. --- lisp/image.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/image.el b/lisp/image.el index 4815f009490..a149caa1a97 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -559,7 +559,12 @@ If VALUE is nil, PROPERTY is removed from IMAGE." (declare (gv-setter image--set-property)) (plist-get (cdr image) property)) -(defun image-compute-scaling-factor (scaling) +(defun image-compute-scaling-factor (&optional scaling) + "Compute the scaling factor based on SCALING. +If a number, use that. If it's `auto', compute the factor. +If nil, use the `image-scaling-factor' variable." + (unless scaling + (setq scaling image-scaling-factor)) (cond ((numberp scaling) scaling) ((eq scaling 'auto) -- 2.39.5