Elm: Simplify elm photo size handling.
authorBrett Nash <nash@nash.id.au>
Wed, 8 Sep 2010 04:54:46 +0000 (04:54 +0000)
committerBrett Nash <nash@nash.id.au>
Wed, 8 Sep 2010 04:54:46 +0000 (04:54 +0000)
Also don't carry around a negative size when it's not used.

SVN revision: 51967

src/lib/elm_photo.c

index 7ab57f15710856f8352f4710a0dc183d0a0243e6..bbecd444c2bb594cd87080fda23f83f09c21008b 100644 (file)
@@ -190,12 +190,10 @@ elm_photo_size_set(Evas_Object *obj, int size)
    ELM_CHECK_WIDTYPE(obj, widtype);
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
-   wd->size = size;
 
-   if(size >= 0)
-          _els_smart_icon_scale_size_set(wd->img, size);
-   else
-          _els_smart_icon_scale_size_set(wd->img, 0);
+   wd->size = (size > 0) ? size : 0;
+
+   _els_smart_icon_scale_size_set(wd->img, wd->size);
 
    _sizing_eval(obj);
 }