diff --git a/lisp/calc/calccomp.el b/lisp/calc/calccomp.el index 73a627f178c..86a2c405272 100644 --- a/lisp/calc/calccomp.el +++ b/lisp/calc/calccomp.el @@ -1558,8 +1558,12 @@ Not all brackets have midpieces.") (setq c (cdr c)) (while (setq c (cdr c)) (if (eq (car-safe (car c)) 'rule) - (math-comp-add-string (make-string maxwid (nth 1 (car c))) - math-comp-hpos math-comp-vpos) + (let* ((sep (nth 1 (car c))) + (rule-width (ceiling + (* maxwid (string-pixel-width "-")) + (string-pixel-width (char-to-string sep))))) + (math-comp-add-string (make-string rule-width sep) + math-comp-hpos math-comp-vpos)) (let ((math-comp-hpos (+ math-comp-hpos (/ (* bias (- maxwid (car widths))) 2))))