emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 5ba738e: Make image-compute-scaling-factor argument optional


From: Lars Ingebrigtsen
Subject: master 5ba738e: Make image-compute-scaling-factor argument optional
Date: Mon, 8 Nov 2021 23:55:40 -0500 (EST)

branch: master
commit 5ba738eb0a24e54852e3a5fb11894a3f39355b7e
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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 4815f00..a149caa 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]