]> Pileus Git - ~andy/gtk/commitdiff
Fixed assertions in gtk_cell_renderer_get_aligned_area().
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Wed, 12 Jan 2011 16:12:33 +0000 (01:12 +0900)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Wed, 12 Jan 2011 16:16:19 +0000 (01:16 +0900)
The assertions here were not accounting for the possiblility of
zero width visible renderers that are aligned completely to the
right (i.e. renderers with no content set for a said row).

gtk/gtkcellrenderer.c

index b2ef07b4a5e759646549c391c4fbc1be911b1d88..b5e738a08ccb27604adae95f2eb12c036f8d9d65 100644 (file)
@@ -1658,8 +1658,8 @@ gtk_cell_renderer_get_aligned_area (GtkCellRenderer      *cell,
   klass = GTK_CELL_RENDERER_GET_CLASS (cell);
   klass->get_aligned_area (cell, widget, flags, cell_area, aligned_area);
 
-  g_assert (aligned_area->x >= cell_area->x && aligned_area->x < cell_area->x + cell_area->width);
-  g_assert (aligned_area->y >= cell_area->y && aligned_area->y < cell_area->y + cell_area->height);
+  g_assert (aligned_area->x >= cell_area->x && aligned_area->x <= cell_area->x + cell_area->width);
+  g_assert (aligned_area->y >= cell_area->y && aligned_area->y <= cell_area->y + cell_area->height);
   g_assert ((aligned_area->x - cell_area->x) + aligned_area->width <= cell_area->width);
   g_assert ((aligned_area->y - cell_area->y) + aligned_area->height <= cell_area->height);
 }