emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/git-commit ecfaa32: Fix gravatar image size again


From: ELPA Syncer
Subject: [nongnu] elpa/git-commit ecfaa32: Fix gravatar image size again
Date: Sun, 17 Oct 2021 09:57:41 -0400 (EDT)

branch: elpa/git-commit
commit ecfaa325a30fc000074915d03f00e18d8dbc4a09
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Fix gravatar image size again
    
    Go back to include the height of the decent part in the calculation.
    The actual problem was that on hidef monitors the `:scale' is set to
    a number greater than 1 (rendering our careful calculation moot) and
    our attempt to override that failed.
---
 Documentation/RelNotes/3.4.0.org |  2 ++
 lisp/magit-diff.el               | 15 ++++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/Documentation/RelNotes/3.4.0.org b/Documentation/RelNotes/3.4.0.org
index a1b62bb..96365c2 100644
--- a/Documentation/RelNotes/3.4.0.org
+++ b/Documentation/RelNotes/3.4.0.org
@@ -16,3 +16,5 @@
 
 - Due to a regression in v3.3.0 setting the mark did not highlight the
   current and only selected section until a second section is selected.
+
+- Fixed calculation of gravatar image size.
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 97c4ac6..1a827f6 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2711,7 +2711,8 @@ or a ref which is not a branch, then it inserts nothing."
       (when-let ((window (get-buffer-window)))
         (let* ((column   (length (match-string 0)))
                (font-obj (query-font (font-at (point) window)))
-               (size     (* 2 (aref font-obj 4)))
+               (size     (* 2 (+ (aref font-obj 4)
+                                 (aref font-obj 5))))
                (align-to (+ column
                             (ceiling (/ size (aref font-obj 7) 1.0))
                             1))
@@ -2736,12 +2737,12 @@ or a ref which is not a branch, then it inserts 
nothing."
                                (car-safe
                                 (get-text-property (point) 'display)))
                               'image)))
-            (let ((top `((,@image
-                          :ascent center :relief 1 :scale 1 :height ,size)
-                         (slice 0.0 0.0 1.0 0.5)))
-                  (bot `((,@image
-                          :ascent center :relief 1 :scale 1 :height ,size)
-                         (slice 0.0 0.5 1.0 1.0)))
+            (setf (image-property image :ascent) 'center)
+            (setf (image-property image :relief) 1)
+            (setf (image-property image :scale)  1)
+            (setf (image-property image :height) size)
+            (let ((top (list image '(slice 0.0 0.0 1.0 0.5)))
+                  (bot (list image '(slice 0.0 0.5 1.0 1.0)))
                   (align `((space :align-to ,align-to))))
               (when magit-revision-use-gravatar-kludge
                 (cl-rotatef top bot))



reply via email to

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