emacs-diffs
[Top][All Lists]
Advanced

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

master b79055e: Don't resize images in image-mode if we have a rotation


From: Lars Ingebrigtsen
Subject: master b79055e: Don't resize images in image-mode if we have a rotation
Date: Tue, 16 Feb 2021 08:01:03 -0500 (EST)

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

    Don't resize images in image-mode if we have a rotation
    
    * lisp/image-mode.el (image-fit-to-window): Don't resize of we
    have a manually rotated imaged (and explain the resizing logic a
    bit).
---
 lisp/image-mode.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lisp/image-mode.el b/lisp/image-mode.el
index 9ed295e..ec0a559 100644
--- a/lisp/image-mode.el
+++ b/lisp/image-mode.el
@@ -985,7 +985,13 @@ Otherwise, display the image by calling `image-mode'."
                    (edges (window-inside-pixel-edges window))
                    (window-width  (- (nth 2 edges) (nth 0 edges)))
                    (window-height (- (nth 3 edges) (nth 1 edges))))
+              ;; If the size has been changed manually (with `+'/`-'),
+              ;; then :max-width/:max-height is nil.  In that case, do
+              ;; no automatic resizing.
               (when (and image-width image-height
+                         ;; Don't do resizing if we have a manual
+                         ;; rotation (from the `r' command), either.
+                         (not (plist-get (cdr spec) :rotation))
                          (or (not (= image-width  window-width))
                              (not (= image-height window-height))))
                 (unless image-fit-to-window-lock



reply via email to

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