forked from enlightenment/efl
elm_box: use correct aspect ratio for HORIZONTAL layout
ratio should be flipped in this case @fix
This commit is contained in:
parent
531422a2bb
commit
049d0c1f4c
|
@ -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 */
|
/* set height using aspect+width */
|
||||||
if (fw) *ow = ww;
|
if (fw) *ow = ww;
|
||||||
if ((maxw >= 0) && (maxw < *ow)) *ow = maxw;
|
if ((maxw >= 0) && (maxw < *ow)) *ow = maxw;
|
||||||
*oh = ratio / *ow;
|
*oh = (1 / ratio) * *ow;
|
||||||
/* apply min/max */
|
/* apply min/max */
|
||||||
if ((maxh >= 0) && (maxh < *oh)) *oh = maxh;
|
if ((maxh >= 0) && (maxh < *oh)) *oh = maxh;
|
||||||
else if ((minh >= 0) && (minh > *oh)) *oh = minh;
|
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 */
|
/* set height using aspect+width */
|
||||||
if (fw) *ow = ww;
|
if (fw) *ow = ww;
|
||||||
if ((maxw >= 0) && (maxw < *ow)) *ow = maxw;
|
if ((maxw >= 0) && (maxw < *ow)) *ow = maxw;
|
||||||
*oh = ratio / *ow;
|
*oh = (1 / ratio) * *ow;
|
||||||
/* apply min/max */
|
/* apply min/max */
|
||||||
if ((maxh >= 0) && (maxh < *oh)) *oh = maxh;
|
if ((maxh >= 0) && (maxh < *oh)) *oh = maxh;
|
||||||
else if ((minh >= 0) && (minh > *oh)) *oh = minh;
|
else if ((minh >= 0) && (minh > *oh)) *oh = minh;
|
||||||
|
|
Loading…
Reference in New Issue