mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
; calc: Correct width of rules composed of Unicode glyphs
With higher values of 'calc-string-maximum-character', rules made up of glyphs of non-unit width can be the wrong length. Calculate the number of characters in the rule based on the display width, rounded up to the nearest integer. Refines feature introduced in bug#78528. * lisp/calc/calccomp.el (math-comp-simplify-term): Calculate rule width with a ratio of 'string-pixel-width's.
This commit is contained in:
parent
b233ca80e9
commit
6e37af1fe8
1 changed files with 6 additions and 2 deletions
|
|
@ -1558,8 +1558,12 @@ Not all brackets have midpieces.")
|
||||||
(setq c (cdr c))
|
(setq c (cdr c))
|
||||||
(while (setq c (cdr c))
|
(while (setq c (cdr c))
|
||||||
(if (eq (car-safe (car c)) 'rule)
|
(if (eq (car-safe (car c)) 'rule)
|
||||||
(math-comp-add-string (make-string maxwid (nth 1 (car c)))
|
(let* ((sep (nth 1 (car c)))
|
||||||
math-comp-hpos math-comp-vpos)
|
(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
|
(let ((math-comp-hpos (+ math-comp-hpos (/ (* bias (- maxwid
|
||||||
(car widths)))
|
(car widths)))
|
||||||
2))))
|
2))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue