a11y: don't return random numbers
Return 0 for the image size if we don't have a pixbuf to measure.
This commit is contained in:
@ -129,6 +129,9 @@ gtk_image_cell_accessible_get_image_size (AtkImage *image,
|
|||||||
GtkCellRenderer *cell_renderer;
|
GtkCellRenderer *cell_renderer;
|
||||||
GdkPixbuf *pixbuf = NULL;
|
GdkPixbuf *pixbuf = NULL;
|
||||||
|
|
||||||
|
*width = 0;
|
||||||
|
*height = 0;
|
||||||
|
|
||||||
cell_renderer = GTK_RENDERER_CELL_ACCESSIBLE (cell)->renderer;
|
cell_renderer = GTK_RENDERER_CELL_ACCESSIBLE (cell)->renderer;
|
||||||
g_object_get (GTK_CELL_RENDERER_PIXBUF (cell_renderer),
|
g_object_get (GTK_CELL_RENDERER_PIXBUF (cell_renderer),
|
||||||
"pixbuf", &pixbuf,
|
"pixbuf", &pixbuf,
|
||||||
|
|||||||
@ -7316,6 +7316,9 @@ gtk_icon_view_item_accessible_get_image_size (AtkImage *image,
|
|||||||
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
if (atk_state_set_contains_state (item->state_set, ATK_STATE_DEFUNCT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
*width = 0;
|
||||||
|
*height = 0;
|
||||||
|
|
||||||
if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
|
if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
|
||||||
{
|
{
|
||||||
*width = box.width;
|
*width = box.width;
|
||||||
|
|||||||
Reference in New Issue
Block a user