forked from enlightenment/efl
evas grid smart - fix divide by 0
if object happens to be 0x0 then we can get a divide by 0... fix! @fix
This commit is contained in:
parent
5097ba893b
commit
3cb947d1a5
|
@ -229,6 +229,8 @@ _evas_object_grid_smart_calculate(Evas_Object *o)
|
||||||
{
|
{
|
||||||
long long x1, y1, x2, y2;
|
long long x1, y1, x2, y2;
|
||||||
|
|
||||||
|
if (vwl > 0)
|
||||||
|
{
|
||||||
if (!mirror)
|
if (!mirror)
|
||||||
{
|
{
|
||||||
x1 = xl + ((wl * (long long)opt->x) / vwl);
|
x1 = xl + ((wl * (long long)opt->x) / vwl);
|
||||||
|
@ -239,8 +241,22 @@ _evas_object_grid_smart_calculate(Evas_Object *o)
|
||||||
x1 = xl + ((wl * (vwl - (long long)(opt->x + opt->w))) / vwl);
|
x1 = xl + ((wl * (vwl - (long long)(opt->x + opt->w))) / vwl);
|
||||||
x2 = xl + ((wl * (vwl - (long long)opt->x)) / vwl);
|
x2 = xl + ((wl * (vwl - (long long)opt->x)) / vwl);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x1 = xl;
|
||||||
|
x2 = xl;
|
||||||
|
}
|
||||||
|
if (vhl > 0)
|
||||||
|
{
|
||||||
y1 = yl + ((hl * (long long)opt->y) / vhl);
|
y1 = yl + ((hl * (long long)opt->y) / vhl);
|
||||||
y2 = yl + ((hl * (long long)(opt->y + opt->h)) / vhl);
|
y2 = yl + ((hl * (long long)(opt->y + opt->h)) / vhl);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
y1 = yl;
|
||||||
|
y2 = yl;
|
||||||
|
}
|
||||||
evas_object_move(opt->obj, x1, y1);
|
evas_object_move(opt->obj, x1, y1);
|
||||||
evas_object_resize(opt->obj, x2 - x1, y2 - y1);
|
evas_object_resize(opt->obj, x2 - x1, y2 - y1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue