don't draw if icon is not valid
This commit is contained in:
parent
c248d9afca
commit
b3f1b213a6
|
@ -37,6 +37,10 @@ iconbox_draw(Widget *widget, DrawCtx *ctx, int offset,
|
||||||
Data *d = widget->data;
|
Data *d = widget->data;
|
||||||
Area area = draw_get_image_size(d->image);
|
Area area = draw_get_image_size(d->image);
|
||||||
|
|
||||||
|
/* image not valid */
|
||||||
|
if(area.width < 0 || area.height < 0)
|
||||||
|
return (widget->area.width = 0);
|
||||||
|
|
||||||
if(d->resize)
|
if(d->resize)
|
||||||
widget->area.width = ((double) widget->statusbar->height / area.height) * area.width;
|
widget->area.width = ((double) widget->statusbar->height / area.height) * area.width;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue