diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2019-05-29 09:13:10 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-05-29 12:29:03 -0400 |
commit | 738241c0bd162a26429b98437247ec42159bb0d9 (patch) | |
tree | c9df7fa810a9cc870be68b2175e75aa236efd91e /src/lib/edje/edje_calc.c | |
parent | f68e93be8daa60392d5c733bc6384b10e2b70c41 (diff) |
edje/calc: correctly handle swallow/group objects as clippers for state clips
Summary:
in the case where the clipper being set was an indirect object, it's necessary
to resolve the lookup for that part and use the actual part object to avoid
setting a placeholder rect as the clipper
@fix
Depends on D8850
Reviewers: cedric
Reviewed By: cedric
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8851
Diffstat (limited to '')
-rw-r--r-- | src/lib/edje/edje_calc.c | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index f0380e4fef..0619574e93 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c | |||
@@ -114,6 +114,31 @@ _edje_calc_params_clear(Edje_Calc_Params *p) | |||
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
117 | static inline Eo * | ||
118 | _edje_calc_get_part_object(const Edje_Real_Part *ep) | ||
119 | { | ||
120 | if ((ep->type == EDJE_RP_TYPE_SWALLOW) && ep->typedata.swallow && | ||
121 | ep->typedata.swallow->swallowed_object) | ||
122 | return ep->typedata.swallow->swallowed_object; | ||
123 | return ep->object; | ||
124 | } | ||
125 | |||
126 | static inline void | ||
127 | _edje_calc_handle_state_clip(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *pf) | ||
128 | { | ||
129 | Edje_Real_Part *clip_part = NULL; | ||
130 | Eo *clip_obj = ed->base.clipper; | ||
131 | |||
132 | if ((pf->ext) && (pf->ext->clip_to) && (pf->ext->clip_to->object)) | ||
133 | clip_part = pf->ext->clip_to; | ||
134 | else if (ep->part->clip_to_id >= 0) | ||
135 | clip_part = ed->table_parts[ep->part->clip_to_id % ed->table_parts_size]; | ||
136 | |||
137 | if (clip_part) | ||
138 | clip_obj = _edje_calc_get_part_object(clip_part); | ||
139 | evas_object_clip_set(_edje_calc_get_part_object(ep), clip_obj); | ||
140 | } | ||
141 | |||
117 | void | 142 | void |
118 | _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2, FLOAT_T v3, FLOAT_T v4) | 143 | _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2, FLOAT_T v3, FLOAT_T v4) |
119 | { | 144 | { |
@@ -4761,14 +4786,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
4761 | 4786 | ||
4762 | /* handle clip overrides */ | 4787 | /* handle clip overrides */ |
4763 | if (ed->has_state_clip) | 4788 | if (ed->has_state_clip) |
4764 | { | 4789 | _edje_calc_handle_state_clip(ed, ep, pf); |
4765 | if ((pf->ext) && (pf->ext->clip_to) && (pf->ext->clip_to->object)) | ||
4766 | evas_object_clip_set(ep->object, pf->ext->clip_to->object); | ||
4767 | else if (ep->part->clip_to_id >= 0) | ||
4768 | evas_object_clip_set(ep->object, ed->table_parts[ep->part->clip_to_id % ed->table_parts_size]->object); | ||
4769 | else | ||
4770 | evas_object_clip_set(ep->object, ed->base.clipper); | ||
4771 | } | ||
4772 | break; | 4790 | break; |
4773 | 4791 | ||
4774 | case EDJE_PART_TYPE_TEXT: | 4792 | case EDJE_PART_TYPE_TEXT: |
@@ -5026,15 +5044,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta | |||
5026 | (ep->typedata.swallow->swallowed_object)) | 5044 | (ep->typedata.swallow->swallowed_object)) |
5027 | { | 5045 | { |
5028 | if (ed->has_state_clip) | 5046 | if (ed->has_state_clip) |
5029 | { | 5047 | _edje_calc_handle_state_clip(ed, ep, pf); |
5030 | if ((pf->ext) && (pf->ext->clip_to) && (pf->ext->clip_to->object)) | ||
5031 | evas_object_clip_set(ep->typedata.swallow->swallowed_object, pf->ext->clip_to->object); | ||
5032 | else if (ep->part->clip_to_id >= 0) | ||
5033 | evas_object_clip_set(ep->typedata.swallow->swallowed_object, ed->table_parts[ep->part->clip_to_id % ed->table_parts_size]->object); | ||
5034 | else | ||
5035 | evas_object_clip_set(ep->typedata.swallow->swallowed_object, ed->base.clipper); | ||
5036 | } | ||
5037 | |||
5038 | if (pf->visible) | 5048 | if (pf->visible) |
5039 | { | 5049 | { |
5040 | Eina_Bool vis = EINA_TRUE; | 5050 | Eina_Bool vis = EINA_TRUE; |