forked from enlightenment/enlightenment
apply gadget aspects with greater precision
aspect ratio is not an integer, rounding it prematurely loses precision
This commit is contained in:
parent
13cf6f638d
commit
39b1e09662
|
@ -490,16 +490,16 @@ _site_gadget_aspect(E_Gadget_Config *zgc, Evas_Coord *ww, Evas_Coord *hh, int ax
|
||||||
switch (aspect)
|
switch (aspect)
|
||||||
{
|
{
|
||||||
case EVAS_ASPECT_CONTROL_HORIZONTAL:
|
case EVAS_ASPECT_CONTROL_HORIZONTAL:
|
||||||
*hh = (*ww * ay / ax);
|
*hh = (*ww * (double)ay / ax);
|
||||||
break;
|
break;
|
||||||
case EVAS_ASPECT_CONTROL_VERTICAL:
|
case EVAS_ASPECT_CONTROL_VERTICAL:
|
||||||
*ww = (*hh * ax / ay);
|
*ww = (*hh * (double)ax / ay);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (IS_HORIZ(zgc->site->orient))
|
if (IS_HORIZ(zgc->site->orient))
|
||||||
*ww = (*hh * ax / ay);
|
*ww = (*hh * (double)ax / ay);
|
||||||
else if (IS_VERT(zgc->site->orient))
|
else if (IS_VERT(zgc->site->orient))
|
||||||
*hh = (*ww * ay / ax);
|
*hh = (*ww * (double)ay / ax);
|
||||||
else if (aspect)
|
else if (aspect)
|
||||||
{
|
{
|
||||||
double ar = ax / (double) ay;
|
double ar = ax / (double) ay;
|
||||||
|
@ -512,9 +512,9 @@ _site_gadget_aspect(E_Gadget_Config *zgc, Evas_Coord *ww, Evas_Coord *hh, int ax
|
||||||
*ww = *hh;
|
*ww = *hh;
|
||||||
}
|
}
|
||||||
else if (ar > 1.0)
|
else if (ar > 1.0)
|
||||||
*hh = (*ww * ay / ax);
|
*hh = (*ww * (double)ay / ax);
|
||||||
else
|
else
|
||||||
*ww = (*hh * ax / ay);
|
*ww = (*hh * (double)ax / ay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue