ascii: Update min_breaks along with width and length.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 16 Nov 2018 21:51:38 +0000 (13:51 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 26 Nov 2018 06:12:37 +0000 (22:12 -0800)
min_breaks has to be no larger than the page width (or length), otherwise
the rendering algorithm fails, but the automatic update for TTYs didn't
take that into account.

src/output/ascii.c

index d7ec317d706d39cefc384679bab69c86d9ae998a..db75e69630e2feb4bf5ebf3021c0263bb89c423c 100644 (file)
@@ -354,9 +354,15 @@ update_page_size (struct ascii_driver *a, bool issue_error)
   enum { MIN_WIDTH = 6, MIN_LENGTH = 6 };
 
   if (a->auto_width)
-    a->width = settings_get_viewwidth ();
+    {
+      a->width = settings_get_viewwidth ();
+      a->min_break[H] = a->width / 2;
+    }
   if (a->auto_length)
-    a->length = settings_get_viewlength () - vertical_margins (a);
+    {
+      a->length = settings_get_viewlength () - vertical_margins (a);
+      a->min_break[V] = a->length / 2;
+    }
 
   if (a->width < MIN_WIDTH || a->length < MIN_LENGTH)
     {