forked from AuroraMiddleware/gtk
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:
parent
006d46362c
commit
1090eba9a8
@ -129,6 +129,9 @@ gtk_image_cell_accessible_get_image_size (AtkImage *image,
|
||||
GtkCellRenderer *cell_renderer;
|
||||
GdkPixbuf *pixbuf = NULL;
|
||||
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
||||
cell_renderer = GTK_RENDERER_CELL_ACCESSIBLE (cell)->renderer;
|
||||
g_object_get (GTK_CELL_RENDERER_PIXBUF (cell_renderer),
|
||||
"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))
|
||||
return;
|
||||
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
||||
if (get_pixbuf_box (GTK_ICON_VIEW (item->widget), item->item, &box))
|
||||
{
|
||||
*width = box.width;
|
||||
|
Loading…
Reference in New Issue
Block a user