diff options
Diffstat (limited to 'lisp/emacs-lisp/icons.el')
-rw-r--r-- | lisp/emacs-lisp/icons.el | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/icons.el b/lisp/emacs-lisp/icons.el index a08ac7463ce..86c44830308 100644 --- a/lisp/emacs-lisp/icons.el +++ b/lisp/emacs-lisp/icons.el @@ -196,18 +196,21 @@ present if the icon is represented by an image." (image-supported-file-p file) (propertize " " 'display - (if-let ((height (plist-get keywords :height))) - (create-image file - nil nil - :height (if (eq height 'line) + (let ((props + (append + (if-let ((height (plist-get keywords :height))) + (list :height (if (eq height 'line) (window-default-line-height) - height) - :scale 1 - :rotation (or (plist-get keywords :rotation) 0) - :ascent (if (plist-member keywords :ascent) - (plist-get keywords :ascent) - 'center)) - (create-image file)))))) + height))) + '(:scale 1) + (if-let ((rotation (plist-get keywords :rotation))) + (list :rotation rotation)) + (if-let ((margin (plist-get keywords :margin))) + (list :margin margin)) + (list :ascent (if (plist-member keywords :ascent) + (plist-get keywords :ascent) + 'center))))) + (apply 'create-image file nil nil props)))))) (cl-defmethod icons--create ((_type (eql 'emoji)) icon _keywords) (when-let ((font (and (display-multi-font-p) |