elm_box: use correct aspect ratio for HORIZONTAL layout
authorMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 28 Jul 2017 19:44:43 +0000 (15:44 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 28 Jul 2017 19:40:47 +0000 (15:40 -0400)
ratio should be flipped in this case

@fix

src/lib/elementary/els_box.c

index f7da0bc..03f418f 100644 (file)
@@ -23,7 +23,7 @@ _box_object_aspect_calc(int *ow, int *oh, int minw, int minh, int maxw, int maxh
         /* set height using aspect+width */
         if (fw) *ow = ww;
         if ((maxw >= 0) && (maxw < *ow)) *ow = maxw;
-        *oh = ratio / *ow;
+        *oh = (1 / ratio) * *ow;
         /* apply min/max */
         if ((maxh >= 0) && (maxh < *oh)) *oh = maxh;
         else if ((minh >= 0) && (minh > *oh)) *oh = minh;
@@ -53,7 +53,7 @@ _box_object_aspect_calc(int *ow, int *oh, int minw, int minh, int maxw, int maxh
         /* set height using aspect+width */
         if (fw) *ow = ww;
         if ((maxw >= 0) && (maxw < *ow)) *ow = maxw;
-        *oh = ratio / *ow;
+        *oh = (1 / ratio) * *ow;
         /* apply min/max */
         if ((maxh >= 0) && (maxh < *oh)) *oh = maxh;
         else if ((minh >= 0) && (minh > *oh)) *oh = minh;