[PATCH 2/3] Table print: Add an extra line bellow the table header

Lubomir I. Ivanov neolit123 at gmail.com
Sun Mar 10 05:50:01 PDT 2013


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

In 'table print' for some launguages the table header titles can span
on two lines and the text on the second line ends up overlapping with
the table border. With this patch two lines are reserved for the table
header instead of one.

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---

a quick solution...there may be better ideas out there.
---
 print.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/print.c b/print.c
index a04725d..2d2476f 100644
--- a/print.c
+++ b/print.c
@@ -797,8 +797,8 @@ static void draw_table(GtkPrintOperation *operation, GtkPrintContext *context, g
 	/* Get the height for an only line but move two down */
 	pango_layout_get_extents(layout, NULL, &logic_ext);
 	delta_y = logic_ext.height;
-	cairo_translate (cr, 0, 2.0 * delta_y / PANGO_SCALE);
-	y += 2.0 * delta_y / PANGO_SCALE;
+	cairo_translate (cr, 0, 3.0 * delta_y / PANGO_SCALE);
+	y += 3.0 * delta_y / PANGO_SCALE;
 	for (i = 0; i < dive_table.nr - nr; i++) {
 		dive = get_dive_for_printing(nr+i);
 		if (!dive)
@@ -811,7 +811,7 @@ static void draw_table(GtkPrintOperation *operation, GtkPrintContext *context, g
 		/* and move down by the max. height of it */
 		cairo_translate (cr, 0, (max_ext + delta_y / 2) / PANGO_SCALE);
 		y += (max_ext + delta_y / 2) / PANGO_SCALE;
-		if (y > 1.9 * h)
+		if (y > 1.95 * h)
 			break;
 	}
 	if (paginate)
-- 
1.7.11.msysgit.0



More information about the subsurface mailing list