From 5737b1da42ad79dae7f9a4fdcda9ea716846019c Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 13 Apr 2004 14:14:12 +0000 Subject: Aha, _that's_ why paragraphs weren't properly justified. Confusion of semantics as to whether a `last' pointer pointed to the last relevant thing in a list, or the one beyond that. Oops. [originally from svn r4059] --- paper.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'paper.h') diff --git a/paper.h b/paper.h index 6a4e353..3b4a944 100644 --- a/paper.h +++ b/paper.h @@ -151,12 +151,15 @@ struct line_data_Tag { * its starting x position, and by how much the width of spaces * needs to be adjusted for paragraph justification. * - * (`last' may be NULL if it's more convenient.) + * (Unlike most of the `last' pointers defined in this file, + * this `end' pointer points to the word _after_ the last one + * that should be displayed on the line. This is how it's + * returned from wrap_para().) */ word *first; - word *last; + word *end; int xpos; - int space_adjust; /* for justifying paragraphs */ + int hshortfall, nspaces; /* for justifying paragraphs */ /* * Auxiliary text: a section number in a margin, or a list item * bullet or number. Also mention where to display this text @@ -179,7 +182,7 @@ struct line_data_Tag { * These fields are used in the page breaking algorithm. */ int bestcost; - int shortfall, text, space; + int vshortfall, text, space; line_data *page_last; /* last line on a page starting here */ /* * After page breaking, we can assign an actual y-coordinate on -- cgit v1.1