diff options
author | JunsuChoi <jsuya.choi@samsung.com> | 2020-06-03 11:37:23 +0900 |
---|---|---|
committer | Hermet Park <chuneon.park@samsung.com> | 2020-06-03 11:37:23 +0900 |
commit | 442fae5c5621636bf52c3467d6d4c7147fd53a5a (patch) | |
tree | 036bfe1ef2f75a043c78eaa40663f39d3013887f /src/lib/edje/edje_calc.c | |
parent | e94b5d014f42f53bbcc0e3c12693c801a78f9fcf (diff) |
Efl.Canvas.Vg.Object: Optimize Ector Surface Size
Summary:
The ector surface size was determined by the size of the vg object.
vg object is usually sized by the size of the container.
So, the ector surface is set unnecessarily large.
This patch sets the ector surface size to the path boundary.
And the path boundary refers to the stroke width and miterlimit.
Test Plan:
vector sample
{F3887634}
{F3887632}
[grey area is ector surface size]
{F3887633}
Reviewers: Hermet, kimcinoo, smohanty, herb
Reviewed By: Hermet
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11865
Diffstat (limited to '')
-rw-r--r-- | src/lib/edje/edje_calc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 93a99254bf..5d3f42344b 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c | |||
@@ -3319,17 +3319,23 @@ _edje_vector_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EIN | |||
3319 | } | 3319 | } |
3320 | else | 3320 | else |
3321 | { | 3321 | { |
3322 | Eina_Rect viewbox; | ||
3323 | |||
3322 | snprintf(dest_key, sizeof(dest_key), "edje/vectors/%i", new_id); | 3324 | snprintf(dest_key, sizeof(dest_key), "edje/vectors/%i", new_id); |
3323 | 3325 | ||
3324 | efl_file_simple_load(ep->object, ed->file->path, src_key); | 3326 | efl_file_simple_load(ep->object, ed->file->path, src_key); |
3325 | src_root = efl_canvas_vg_object_root_node_get(ep->object); | 3327 | src_root = efl_canvas_vg_object_root_node_get(ep->object); |
3326 | efl_ref(src_root); | 3328 | efl_ref(src_root); |
3327 | 3329 | ||
3330 | // Note: Assume that the viewboxes of two interpolation objects are the same. | ||
3331 | viewbox = efl_canvas_vg_object_viewbox_get(ep->object); | ||
3332 | |||
3328 | efl_file_simple_load(ep->object, ed->file->path, dest_key); | 3333 | efl_file_simple_load(ep->object, ed->file->path, dest_key); |
3329 | dest_root = efl_canvas_vg_object_root_node_get(ep->object); | 3334 | dest_root = efl_canvas_vg_object_root_node_get(ep->object); |
3330 | efl_ref(dest_root); | 3335 | efl_ref(dest_root); |
3331 | 3336 | ||
3332 | root = efl_duplicate(src_root); | 3337 | root = efl_duplicate(src_root); |
3338 | efl_canvas_vg_object_viewbox_set(ep->object, viewbox); | ||
3333 | 3339 | ||
3334 | if (!efl_gfx_path_interpolate(root, src_root, dest_root, pos)) | 3340 | if (!efl_gfx_path_interpolate(root, src_root, dest_root, pos)) |
3335 | ERR("Can't interpolate check the svg file"); | 3341 | ERR("Can't interpolate check the svg file"); |