From: Mira Grudzinska Date: Wed, 7 Apr 2021 21:02:25 +0000 (+0200) Subject: evas vg: fixing the compatibility issue X-Git-Tag: submit/tizen/20210420.103606~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d088c735deee9ae91f0c63439d69789e2b192851;p=platform%2Fupstream%2Fefl.git evas vg: fixing the compatibility issue The current point set after appending the rectangle is different for the rectangles with sharp or with rounded corners. The same logic is applied to the version using ThorVG. Change-Id: Id2908a248b4f9803989d31b2073300f92bba0fc9 --- diff --git a/src/lib/evas/canvas/efl_canvas_vg_shape.c b/src/lib/evas/canvas/efl_canvas_vg_shape.c index fddf4be..5409afc 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_shape.c +++ b/src/lib/evas/canvas/efl_canvas_vg_shape.c @@ -488,6 +488,12 @@ _shape_properties_interpolate(Evas_Vg_Shape *obj, tvg_shape_get_stroke_join(sd_to->shape, &join_to); (pos_map < 0.5) ? tvg_shape_set_stroke_join(sd->shape, join) : tvg_shape_set_stroke_join(sd->shape, join_to); + // Current points + sd->curr.x = _interpolate(sd_from->curr.x, sd_to->curr.x, pos_map); + sd->curr.y = _interpolate(sd_from->curr.y, sd_to->curr.y, pos_map); + sd->curr_ctrl.x = _interpolate(sd_from->curr_ctrl.x, sd_to->curr_ctrl.x, pos_map); + sd->curr_ctrl.y = _interpolate(sd_from->curr_ctrl.y, sd_to->curr_ctrl.y, pos_map); + return EINA_TRUE; } @@ -1518,8 +1524,16 @@ evas_vg_shape_append_rect(Evas_Vg_Shape *obj, double x, double y, double w, doub if (!sd || !sd->shape) return; tvg_shape_append_rect(sd->shape, x, y, w, h, rx, ry); - tvg_shape_move_to(sd->shape, x, y + ry); - _assign_current_point(sd, NULL, x, y + ry); + if (rx <= 0 || ry <= 0) + { + _assign_current_point(sd, NULL, x + w, y); + } + else + { + ry = 2 * ry > h ? h / 2 : ry; + _assign_current_point(sd, NULL, x, y + ry); + tvg_shape_move_to(sd->shape, x, y + h/2); + } #else efl_gfx_path_append_rect(obj, x, y, w, h, rx, ry); #endif