mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-12 00:15:51 -06:00
Fix graph rendering finally
This commit is contained in:
parent
ea0f071839
commit
d0b7bec58d
@ -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;
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user