From: Hermet Park Date: Mon, 18 Feb 2019 05:53:09 +0000 (+0900) Subject: evas vg: avoid integral division not to loss precision. X-Git-Tag: submit/tizen/20190222.001114~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1bd97ddd9874d2c12605229b7ee113b126b31c17;p=platform%2Fupstream%2Fefl.git evas vg: avoid integral division not to loss precision. Change-Id: I887043a78cc03202ec72e9da155440f6d89f1543 --- diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index eba876e..703ebde 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -608,10 +608,10 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F efl_gfx_path_bounds_get(grad_obj, &grad_geom); - double cy = (grad_geom.h / 2) + grad_geom.y; - double cy_scaled = (grad_geom.h / 2) * scale_reversed_Y; - double cx = grad_geom.w / 2 + grad_geom.x; - double cx_scaled = (grad_geom.w / 2) * scale_reversed_X; + double cy = ((double) grad_geom.h) * 0.5 + grad_geom.y; + double cy_scaled = (((double) grad_geom.h) * 0.5) * scale_reversed_Y; + double cx = ((double) grad_geom.w) * 0.5 + grad_geom.x; + double cx_scaled = (((double) grad_geom.w) * 0.5) * scale_reversed_X; /* matrix tranformation of gradient figure: * 0. we remember size of gradient and it's center point