Fix graph rendering finally

This commit is contained in:
berrange@roquette.boston.redhat.com 2006-07-11 15:36:32 -04:00
parent ea0f071839
commit d0b7bec58d
2 changed files with 6 additions and 6 deletions

View File

@ -104,7 +104,7 @@ static void gtk_cell_renderer_sparkline_init (GtkCellRendererSparkline *cellspar
priv = GTK_CELL_RENDERER_SPARKLINE_GET_PRIVATE (cellsparkline);
priv->filled = TRUE;
priv->filled = FALSE;
// priv->filled = FALSE;
priv->data_array = g_value_array_new(0);
}
@ -266,9 +266,9 @@ gtk_cell_renderer_sparkline_render (GtkCellRenderer *cell,
for (index=0;index<data->n_values;index++) {
double cx = ((double)index * pixels_per_point);
double cy = get_y (cell_area, data, index);
points[index].x = cx + cell_area->x;
points[index].y = cy + cell_area->y;
points[index].y = cy;
}
@ -283,13 +283,14 @@ gtk_cell_renderer_sparkline_render (GtkCellRenderer *cell,
/* Render the line: */
cairo_set_line_width (cr, (double)0.5);
#if 0
cairo_move_to(cr, cell_area->x, cell_area->y);
cairo_line_to(cr, cell_area->x, cell_area->y + cell_area->height);
cairo_line_to(cr, cell_area->x + cell_area->width, cell_area->y + cell_area->height);
cairo_line_to(cr, cell_area->x + cell_area->width, cell_area->y);
cairo_line_to(cr, cell_area->x, cell_area->y);
cairo_stroke(cr);
#endif
for (index=0;index<data->n_values;index++) {
double cx = points[index].x;

View File

@ -225,7 +225,6 @@ gtk_sparkline_expose (GtkWidget *widget,
GtkAllocation *cell_area = &widget->allocation;
#if USE_CAIRO
cairo_t *cr;
double margin = 2;
#endif
priv = GTK_SPARKLINE_GET_PRIVATE (widget);
@ -289,7 +288,7 @@ gtk_sparkline_expose (GtkWidget *widget,
}
if (priv->filled) {
double baseline_y = cell_area->height + cell_area->y;
cairo_line_to (cr, cell_area->x + cell_area->width - margin, baseline_y);
cairo_line_to (cr, cell_area->x + cell_area->width, baseline_y);
cairo_line_to (cr, 0, baseline_y);
cairo_fill (cr);
} else {