From 39b1e0966208d529b4ce74028cd6e89d80b1b612 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 169a1445a..4ee44a6c7 100644 --- a/src/bin/e_gadget.c +++ b/src/bin/e_gadget.c @@ -490,16 +490,16 @@ _site_gadget_aspect(E_Gadget_Config *zgc, Evas_Coord *ww, Evas_Coord *hh, int ax 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; @@ -512,9 +512,9 @@ _site_gadget_aspect(E_Gadget_Config *zgc, Evas_Coord *ww, Evas_Coord *hh, int ax *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); } } }