groff-commit
[Top][All Lists]
Advanced

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

[groff] 17/20: [tbl]: Don't spread gaps at table edges.


From: G. Branden Robinson
Subject: [groff] 17/20: [tbl]: Don't spread gaps at table edges.
Date: Fri, 3 Feb 2023 16:47:56 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit efc2e20cb231bc8550c4be83a8ea481cafa82b4b
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Feb 3 12:18:57 2023 -0600

    [tbl]: Don't spread gaps at table edges.
    
    * src/preproc/tbl/table.cpp (table::compute_column_positions): Stop
      multiplying the gaps at the left and right edges of a table (which
      occur when it is boxed or has a leading and/or trailing vertical line)
      by the column separation factor.  Only interior column gaps should be
      spread.  This change prevents tables using the "expand" region option
      from being overset (exceeding the line length), but might not (yet)
      fully expand to that length on low-resolution devices due to integer
      roundoff.
---
 ChangeLog                 | 11 +++++++++++
 src/preproc/tbl/table.cpp |  5 ++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2fe3537ca..4ac8a3fe9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-02-03  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/preproc/tbl/table.cpp (table::compute_column_positions):
+       Stop multiplying the gaps at the left and right edges of a table
+       {which occur when it is boxed or has a leading and/or trailing
+       vertical line} by the column separation factor.  Only interior
+       column gaps should be spread.  This change prevents tables using
+       the "expand" region option from being overset (exceeding the
+       line length), but might not (yet) fully expand to that length on
+       low-resolution devices due to integer roundoff.
+
 2023-02-03  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/preproc/tbl/table.cpp (table::compute_total_separation)
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index cf25ea913..759dbd073 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -2300,8 +2300,7 @@ void table::compute_column_positions()
 {
   prints(".\\\" compute column positions\n");
   printfs(".nr %1 0\n", column_divide_reg(0));
-  printfs(".nr %1 %2*\\n[" SEPARATION_FACTOR_REG "]\n",
-         column_start_reg(0),
+  printfs(".nr %1 %2n\n", column_start_reg(0),
          as_string(left_separation));
   // In nroff mode, compensate for width of vertical rule.
   if (left_separation)
@@ -2323,7 +2322,7 @@ void table::compute_column_positions()
            column_end_reg(i-1),
            column_start_reg(i));
   }
-  printfs(".nr %1 \\n[%2]+(%3*\\n[" SEPARATION_FACTOR_REG "])\n",
+  printfs(".nr %1 \\n[%2]+%3n\n",
          column_divide_reg(ncolumns),
          column_end_reg(i-1),
          as_string(right_separation));



reply via email to

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