summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-07-28 13:49:31 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-07-28 16:21:32 -0400
commit30be540c8a7610f53f3967dbec7527c67ba13961 (patch)
tree134e52dd73ec384c1de54e08a701b83df8a44888
parent8ff092561315ee5ede7594f525c7bafc49c7e999 (diff)
downloadenlightenment-30be540c8a7610f53f3967dbec7527c67ba13961.tar.gz
apply gadget aspects with greater precision
aspect ratio is not an integer, rounding it prematurely loses precision
-rw-r--r--src/bin/e_gadget.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bin/e_gadget.c b/src/bin/e_gadget.c
index 4c778e073b..7ee9d11fc0 100644
--- a/src/bin/e_gadget.c
+++ b/src/bin/e_gadget.c
@@ -398,16 +398,16 @@ _site_gadget_resize(Evas_Object *g, int w, int h, Evas_Coord *ww, Evas_Coord *hh
switch (aspect)
{
case EVAS_ASPECT_CONTROL_HORIZONTAL:
- *hh = (*ww * ay / ax);
+ *hh = (*ww * (double)ay / ax);
break;
case EVAS_ASPECT_CONTROL_VERTICAL:
- *ww = (*hh * ax / ay);
+ *ww = (*hh * (double)ax / ay);
break;
default:
if (IS_HORIZ(zgc->site->orient))
- *ww = (*hh * ax / ay);
+ *ww = (*hh * (double)ax / ay);
else if (IS_VERT(zgc->site->orient))
- *hh = (*ww * ay / ax);
+ *hh = (*ww * (double)ay / ax);
else if (aspect)
{
double ar = ax / (double) ay;
@@ -420,9 +420,9 @@ _site_gadget_resize(Evas_Object *g, int w, int h, Evas_Coord *ww, Evas_Coord *hh
*ww = *hh;
}
else if (ar > 1.0)
- *hh = (*ww * ay / ax);
+ *hh = (*ww * (double)ay / ax);
else
- *ww = (*hh * ax / ay);
+ *ww = (*hh * (double)ax / ay);
}
}
}