From ce7c1006eb908bc68f1c7e54d31b7dddec4bc0eb Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Mon, 8 Jul 2019 23:51:54 +0800 Subject: [PATCH] Improve: calculate font height. --- doom-modeline-core.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doom-modeline-core.el b/doom-modeline-core.el index 3a4a5bb..aa71b32 100644 --- a/doom-modeline-core.el +++ b/doom-modeline-core.el @@ -506,9 +506,9 @@ If the actual char height is larger, it respects the actual char height.") (defun doom-modeline--font-height () "Calculate the actual char height of the mode-line." (let ((height (face-attribute 'mode-line :height))) - (round (* 1.68 (if (number-or-marker-p height) - (/ height 10) - (frame-char-height)))))) + (round (* 1.68 (cond ((integerp height) (/ height 10)) + ((floatp height) (* height (frame-char-height))) + (t (frame-char-height))))))) (defun doom-modeline-icon-octicon (&rest args) "Display octicon via ARGS."