diff options
author | JunsuChoi <jsuya.choi@samsung.com> | 2020-06-16 13:10:25 +0900 |
---|---|---|
committer | Hermet Park <chuneon.park@samsung.com> | 2020-06-16 13:10:25 +0900 |
commit | e53f07f44ff7f7a9454586e3448c1ca23e926a84 (patch) | |
tree | 2ac8eda0931722aef23725ac5e55e3b65092ec4c /src | |
parent | 27cecc3afb276446ead56d3c56cb15afe37ac671 (diff) |
Efl.Canvas.Vg.Object: Fix wrong render area
Summary:
When determining the size of the ector buffer,
it was used the smaller of the object's geometry or path_bounds.
However, because of that, path worked as absolute coordinates.
path_bounds should be relative to geometry of object.
Test Plan:
{F3900444}
original
{F3900445}
before
+ evas_object_geometry_set(vg, 100, 100, 200, 200);
{F3900447}
after
+ evas_object_geometry_set(vg, 100, 100, 200, 200);
{F3900448}
Reviewers: Hermet, kimcinoo, herb, smohanty
Reviewed By: Hermet
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D11974
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/evas/canvas/efl_canvas_vg_object.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 0ce2fbb22d..f2cd687b8f 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c | |||
@@ -719,30 +719,28 @@ _user_vg_entry_render(Evas_Object_Protected_Data *obj, | |||
719 | Eina_Rect render_rect = EINA_RECT(x, y, w, h); | 719 | Eina_Rect render_rect = EINA_RECT(x, y, w, h); |
720 | 720 | ||
721 | // Get changed boundary and fit the size. | 721 | // Get changed boundary and fit the size. |
722 | Eina_Rect r; | ||
723 | if (pd->changed) | 722 | if (pd->changed) |
724 | efl_gfx_path_bounds_get(user_entry->root, &user_entry->path_bounds); | 723 | efl_gfx_path_bounds_get(user_entry->root, &user_entry->path_bounds); |
725 | EINA_RECTANGLE_SET(&r, user_entry->path_bounds.x, | 724 | |
726 | user_entry->path_bounds.y, | 725 | if (user_entry->path_bounds.w != 0 && user_entry->path_bounds.h != 0) |
727 | user_entry->path_bounds.w, | 726 | { |
728 | user_entry->path_bounds.h); | 727 | EINA_RECTANGLE_SET(&render_rect, user_entry->path_bounds.x, |
728 | user_entry->path_bounds.y, | ||
729 | user_entry->path_bounds.w, | ||
730 | user_entry->path_bounds.h); | ||
731 | } | ||
729 | 732 | ||
730 | if (pd->viewbox.w != 0 && pd->viewbox.h !=0) | 733 | if (pd->viewbox.w != 0 && pd->viewbox.h !=0) |
731 | { | 734 | { |
732 | double sx = 0, sy= 0; | 735 | double sx = 0, sy= 0; |
733 | sx = (double)render_rect.w / (double)pd->viewbox.w; | 736 | sx = (double)w / (double)pd->viewbox.w; |
734 | sy = (double)render_rect.h / (double)pd->viewbox.h; | 737 | sy = (double)h / (double)pd->viewbox.h; |
735 | r.pos.x = (r.pos.x - pd->viewbox.x) * sx; | 738 | render_rect.x = (render_rect.x - pd->viewbox.x) * sx; |
736 | r.pos.y = (r.pos.y - pd->viewbox.y) * sy; | 739 | render_rect.y = (render_rect.y - pd->viewbox.y) * sy; |
737 | r.size.w *= sx; | 740 | render_rect.w *= sx; |
738 | r.size.h *= sy; | 741 | render_rect.h *= sy; |
739 | } | 742 | } |
740 | 743 | ||
741 | if (render_rect.x < r.pos.x) render_rect.x = r.pos.x; | ||
742 | if (render_rect.y < r.pos.y) render_rect.y = r.pos.y; | ||
743 | if (render_rect.w > r.size.w) render_rect.w = r.size.w; | ||
744 | if (render_rect.h > r.size.h) render_rect.h = r.size.h; | ||
745 | |||
746 | //if the size doesn't match, drop previous cache surface. | 744 | //if the size doesn't match, drop previous cache surface. |
747 | if ((user_entry->w != render_rect.w ) || | 745 | if ((user_entry->w != render_rect.w ) || |
748 | (user_entry->h != render_rect.h)) | 746 | (user_entry->h != render_rect.h)) |
@@ -778,8 +776,8 @@ _user_vg_entry_render(Evas_Object_Protected_Data *obj, | |||
778 | _render_buffer_to_screen(obj, | 776 | _render_buffer_to_screen(obj, |
779 | engine, output, context, surface, | 777 | engine, output, context, surface, |
780 | buffer, | 778 | buffer, |
781 | x + r.pos.x, | 779 | x + render_rect.x, |
782 | y + r.pos.y, | 780 | y + render_rect.y, |
783 | render_rect.w, render_rect.h, | 781 | render_rect.w, render_rect.h, |
784 | do_async, EINA_TRUE); | 782 | do_async, EINA_TRUE); |
785 | } | 783 | } |