summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7720f4e)
xr_rendering_draw() didn't draw table titles. It seems that this was just
an oversight, so this commit fixes the problem.
xr_rendering_draw() is used by the GUI output viewer window, so this makes
the GUI output viewer display table titles now.
Bug #30554.
+
+static void
+xr_draw_title (struct xr_driver *xr, const char *title, int title_height)
+{
+ struct table_cell cell;
+ int bb[TABLE_N_AXES][2];
+
+ xr_init_caption_cell (title, &cell);
+ bb[H][0] = 0;
+ bb[H][1] = xr->width;
+ bb[V][0] = 0;
+ bb[V][1] = title_height;
+ xr_draw_cell (xr, &cell, bb, bb);
+}
\f
struct output_driver_factory pdf_driver_factory = { "pdf", xr_pdf_create };
struct output_driver_factory ps_driver_factory = { "ps", xr_ps_create };
\f
struct output_driver_factory pdf_driver_factory = { "pdf", xr_pdf_create };
struct output_driver_factory ps_driver_factory = { "ps", xr_ps_create };
struct xr_driver *xr = r->xr;
xr_set_cairo (xr, cr);
struct xr_driver *xr = r->xr;
xr_set_cairo (xr, cr);
+
+ if (r->title_height > 0)
+ {
+ xr->y = 0;
+ xr_draw_title (xr, table_item_get_caption (to_table_item (r->item)),
+ r->title_height);
+ }
+
+ xr->y = r->title_height;
render_page_draw_region (r->page,
x * 1024, y * 1024, w * 1024, h * 1024);
}
render_page_draw_region (r->page,
x * 1024, y * 1024, w * 1024, h * 1024);
}
if (ts->caption_height)
{
if (xr->cairo)
if (ts->caption_height)
{
if (xr->cairo)
- {
- struct table_cell cell;
- int bb[TABLE_N_AXES][2];
-
- xr_init_caption_cell (table_item_get_caption (ts->table_item),
- &cell);
- bb[H][0] = 0;
- bb[H][1] = xr->width;
- bb[V][0] = 0;
- bb[V][1] = ts->caption_height;
- xr_draw_cell (xr, &cell, bb, bb);
- }
+ xr_draw_title (xr, table_item_get_caption (ts->table_item),
+ ts->caption_height);
+
xr->y += ts->caption_height;
ts->caption_height = 0;
}
xr->y += ts->caption_height;
ts->caption_height = 0;
}