fix resize handling for emotion
authorraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 6 Oct 2011 02:41:24 +0000 (02:41 +0000)
committerraster <raster@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 6 Oct 2011 02:41:24 +0000 (02:41 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/emotion@63868 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/emotion_smart.c

index d3f32c9..9a777d5 100644 (file)
@@ -79,6 +79,8 @@ struct _Smart_Data
       int b; /* bottom */
       Evas_Object *clipper;
    } crop;
+   
+   int            w, h;
 
    double         ratio;
    double         pos;
@@ -410,7 +412,10 @@ emotion_object_file_set(Evas_Object *obj, const char *file)
    DBG("file=%s", file);
    if (!sd->module) return EINA_FALSE;
 
-   if ((file) && (sd->file) && (file == sd->file || !strcmp(file, sd->file))) return EINA_FALSE;
+   sd->w = 0;
+   sd->h = 0;
+   if ((file) && (sd->file) && 
+       ((file == sd->file) || (!strcmp(file, sd->file)))) return EINA_FALSE;
    if ((file) && (file[0] != 0))
      {
        eina_stringshare_replace(&sd->file, file);
@@ -780,7 +785,8 @@ emotion_object_size_get(const Evas_Object *obj, int *iw, int *ih)
    if (iw) *iw = 0;
    if (ih) *ih = 0;
    E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
-   evas_object_image_size_get(sd->obj, iw, ih);
+   if (iw) *iw = sd->w;
+   if (ih) *ih = sd->h;
 }
 
 EAPI void
@@ -1480,6 +1486,8 @@ _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio)
    evas_object_image_size_get(sd->obj, &iw, &ih);
    if ((w != iw) || (h != ih))
      {
+        sd->w = w;
+        sd->h = h;
         _emotion_image_data_zero(sd->obj);
        changed = 1;
      }