Evas textblock: Fixed a bug with scaling items.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Jul 2011 12:49:29 +0000 (12:49 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Jul 2011 12:49:29 +0000 (12:49 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@61334 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/canvas/evas_object_textblock.c

index e9a6698..805ec9f 100644 (file)
@@ -2290,17 +2290,14 @@ _layout_calculate_format_item_size(const Evas_Object *obj,
    switch (fi->size)
      {
       case SIZE:
-         if (!strncmp(s, "item", 4))
+         p = strstr(s, " size=");
+         if (p)
            {
-              p = strstr(s, " size=");
-              if (p)
+              p += 6;
+              if (sscanf(p, "%ix%i", &w, &h) == 2)
                 {
-                   p += 6;
-                   if (sscanf(p, "%ix%i", &w, &h) == 2)
-                     {
-                        w = w * obj->cur.scale;
-                        h = h * obj->cur.scale;
-                     }
+                   w = w * obj->cur.scale;
+                   h = h * obj->cur.scale;
                 }
            }
          break;
@@ -2335,22 +2332,22 @@ _layout_calculate_format_item_size(const Evas_Object *obj,
          switch (fi->vsize)
            {
             case VSIZE_FULL:
-               if (fi->parent.h > (*maxdescent + *maxascent))
+               if (h > (*maxdescent + *maxascent))
                  {
-                    *maxascent += fi->parent.h - (*maxdescent + *maxascent);
+                    *maxascent += h - (*maxdescent + *maxascent);
                     *_y = -*maxascent;
                  }
                else
-                  *_y = -(fi->parent.h - *maxdescent);
+                  *_y = -(h - *maxdescent);
                break;
             case VSIZE_ASCENT:
-               if (fi->parent.h > *maxascent)
+               if (h > *maxascent)
                  {
-                    *maxascent = fi->parent.h;
-                    *_y = -fi->parent.h;
+                    *maxascent = h;
+                    *_y = -h;
                  }
                else
-                  *_y = -fi->parent.h;
+                  *_y = -h;
                break;
             default:
                break;