Commit b1b4199d authored by Jean Bréfort's avatar Jean Bréfort Committed by Jean Bréfort

also render sheet objects.

2008-10-04  Jean Brefort  <jean.brefort@normalesup.org>

	* component/gnumeric.c: (go_gnm_component_render): also render sheet
	objects.


svn path=/trunk/; revision=16854
parent 653e12e3
2008-10-04 Jean Brefort <jean.brefort@normalesup.org>
* component/gnumeric.c: (go_gnm_component_render): also render sheet
objects.
2008-10-03 Morten Welinder <terra@gnome.org>
* src/collect.c (float_range_function2d): New function.
......
......@@ -161,10 +161,36 @@ go_gnm_component_render (GOComponent *component, cairo_t *cr, double width_pixel
{
GOGnmComponent *gognm = GO_GNM_COMPONENT (component);
GnmRange range;
double xoffset = 0., yoffset;
GSList *l;
SheetObject *so;
SheetObjectAnchor const *anchor;
range_init (&range, gognm->col_start, gognm->row_start, gognm->col_end, gognm->row_end);
cairo_scale (cr, ((double) width_pixels) / gognm->width, ((double) height_pixels) / gognm->height);
gnm_gtk_print_cell_range (NULL, cr, gognm->sheet, &range, 0., 0., TRUE);
/* Now render objects */
l = gognm->sheet->sheet_objects;
while (l) {
so = SHEET_OBJECT (l->data);
anchor = sheet_object_get_anchor (so);
/* test if the object overlaps the exposed range */
if ((anchor->cell_bound.start.col <= gognm->col_end) &&
(anchor->cell_bound.end.col >= gognm->col_start) &&
(anchor->cell_bound.start.row <= gognm->row_end) &&
(anchor->cell_bound.end.row >= gognm->row_start)) {
/* translate the origin to start cell of object */
xoffset = sheet_col_get_distance_pts (gognm->sheet, gognm->col_start,
anchor->cell_bound.start.col);
yoffset = sheet_row_get_distance_pts (gognm->sheet, gognm->row_start,
anchor->cell_bound.start.row);
cairo_save (cr);
cairo_translate (cr, xoffset, yoffset);
sheet_object_draw_cairo (so, cr, TRUE);
cairo_restore (cr);
}
l = l->next;
}
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment