From: Dmitry Gutov Date: Sat, 13 Sep 2014 21:58:26 +0000 (+0400) Subject: diff-hl-define-bitmaps: Handle text scaling and line spacing better X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/c246d4451c3ff86bfc562a22d90647b9a4b483be diff-hl-define-bitmaps: Handle text scaling and line spacing better --- diff --git a/diff-hl.el b/diff-hl.el index 4e73bb72a..73276c3be 100644 --- a/diff-hl.el +++ b/diff-hl.el @@ -122,11 +122,11 @@ (numberp text-scale-mode-amount)) (expt text-scale-mode-step text-scale-mode-amount) 1)) - (spacing (or (default-value 'line-spacing) 0)) - (h (round (+ (* (frame-char-height) scale) - (if (floatp spacing) - (* (frame-char-height) spacing) - spacing)))) + (spacing (or (and (display-graphic-p) (default-value 'line-spacing)) 0)) + (h (+ (ceiling (* (frame-char-height) scale)) + (if (floatp spacing) + (truncate (* (frame-char-height) spacing)) + spacing))) (w (frame-parameter nil 'left-fringe)) (middle (make-vector h (expt 2 (1- w)))) (ones (1- (expt 2 w)))