emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/page-break-lines 610dbdc9d3 51/80: Perform width calculati


From: ELPA Syncer
Subject: [nongnu] elpa/page-break-lines 610dbdc9d3 51/80: Perform width calculations pixel-wise to increase accuracy
Date: Tue, 5 Sep 2023 04:03:07 -0400 (EDT)

branch: elpa/page-break-lines
commit 610dbdc9d39a37912e2b8bfbd3e3d15c7e5d622f
Author: Steve Purcell <steve@sanityinc.com>
Commit: Steve Purcell <steve@sanityinc.com>

    Perform width calculations pixel-wise to increase accuracy
---
 page-break-lines.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/page-break-lines.el b/page-break-lines.el
index b2feda82b0..dd65ba692d 100644
--- a/page-break-lines.el
+++ b/page-break-lines.el
@@ -126,12 +126,12 @@ its display table will be modified as necessary."
             (let ((default-height (face-attribute 'default :height nil 
'default)))
               (set-face-attribute 'page-break-lines nil :height default-height)
               (let* ((cwidth (char-width page-break-lines-char))
-                     (wwidth (- (window-width)
-                                (if (bound-and-true-p display-line-numbers)
-                                    (+ (line-number-display-width) 2)
-                                  0)
-                                (if (display-graphic-p) 0 1)))
-                     (width (/ wwidth cwidth))
+                     (wwidth-pix (- (window-width nil t)
+                                    (if (bound-and-true-p display-line-numbers)
+                                        (line-number-display-width t)
+                                      0)))
+                     (width (- (/ wwidth-pix (frame-char-width) cwidth)
+                               (if (display-graphic-p) 0 1)))
                      (glyph (make-glyph-code page-break-lines-char 
'page-break-lines))
                      (new-display-entry (vconcat (make-list width glyph))))
                 (unless (equal new-display-entry (elt buffer-display-table 
?\^L))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]