From 30be540c8a7610f53f3967dbec7527c67ba13961 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 28 Jul 2017 13:49:31 -0400 Subject: [PATCH] apply gadget aspects with greater precision aspect ratio is not an integer, rounding it prematurely loses precision --- src/bin/e_gadget.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/e_gadget.c b/src/bin/e_gadget.c index 4c778e073..7ee9d11fc 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); } } }