diff options
author | Hermet Park <hermetpark@gmail.com> | 2018-06-14 19:51:13 +0900 |
---|---|---|
committer | Hermet Park <hermetpark@gmail.com> | 2018-06-14 20:02:15 +0900 |
commit | a7e4c6703937fba7c1c5bafc7dcad7f321495288 (patch) | |
tree | 61b5ab55eb270fa13818b5a256b3eeecf63e931d /src/lib/efl/interfaces/efl_gfx_shape.c | |
parent | a5f0e2ecdfd5446b75758b1eb7f2d2767afd6f3d (diff) |
evas vg: fix broken morphing(interpolation)
efl_gfx_path itself took care of efl_gfx_shape data but its heirarchy was
conceptually wrong. Even efl_gfx_shape is mixing the efl_gfx_path...
Damend design...
Some of derived classes of efl_gfx_path (i.e. Vg.Node and Vg.Container) are
none of the Path acutally. They are just mixing Path's interpolation interface.
So, Here patch changes VG.Node to stop calling the super's interpolate method
and Vg.Shape to call both super -gfx_shape and vg_node- interpolate method.
@fix T6996
Diffstat (limited to '')
-rw-r--r-- | src/lib/efl/interfaces/efl_gfx_shape.c | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/src/lib/efl/interfaces/efl_gfx_shape.c b/src/lib/efl/interfaces/efl_gfx_shape.c index 6ad08a1d1e..a6042f9de3 100644 --- a/src/lib/efl/interfaces/efl_gfx_shape.c +++ b/src/lib/efl/interfaces/efl_gfx_shape.c | |||
@@ -62,23 +62,29 @@ _efl_gfx_property_get(const Eo *obj, Efl_Gfx_Property *property) | |||
62 | 62 | ||
63 | EOLIAN static Eina_Bool | 63 | EOLIAN static Eina_Bool |
64 | _efl_gfx_shape_efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd, | 64 | _efl_gfx_shape_efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd, |
65 | const Eo *from, const Eo *to, double pos_map) | 65 | const Eo *from, const Eo *to, |
66 | double pos_map) | ||
66 | { | 67 | { |
67 | Efl_Gfx_Shape_Data *from_pd, *to_pd; | 68 | Efl_Gfx_Shape_Data *from_pd, *to_pd; |
68 | Efl_Gfx_Property property_from, property_to; | 69 | Efl_Gfx_Property property_from, property_to; |
69 | Efl_Gfx_Dash *dash = NULL; | 70 | Efl_Gfx_Dash *dash = NULL; |
71 | double interv; //interpolated value | ||
70 | unsigned int i; | 72 | unsigned int i; |
71 | 73 | ||
72 | from_pd = efl_data_scope_get(from, EFL_GFX_SHAPE_MIXIN); | ||
73 | to_pd = efl_data_scope_get(to, EFL_GFX_SHAPE_MIXIN); | ||
74 | if (!efl_isa(from, EFL_GFX_SHAPE_MIXIN) || !efl_isa(to, EFL_GFX_SHAPE_MIXIN)) | 74 | if (!efl_isa(from, EFL_GFX_SHAPE_MIXIN) || !efl_isa(to, EFL_GFX_SHAPE_MIXIN)) |
75 | return EINA_FALSE; | 75 | return EINA_FALSE; |
76 | |||
77 | from_pd = efl_data_scope_get(from, EFL_GFX_SHAPE_MIXIN); | ||
78 | to_pd = efl_data_scope_get(to, EFL_GFX_SHAPE_MIXIN); | ||
79 | |||
76 | if ((pd == from_pd) || (pd == to_pd)) return EINA_FALSE; | 80 | if ((pd == from_pd) || (pd == to_pd)) return EINA_FALSE; |
77 | 81 | ||
78 | _efl_gfx_property_get(from, &property_from); | 82 | _efl_gfx_property_get(from, &property_from); |
79 | _efl_gfx_property_get(to, &property_to); | 83 | _efl_gfx_property_get(to, &property_to); |
80 | 84 | ||
81 | if (property_from.dash_length != property_to.dash_length) return EINA_FALSE; | 85 | //Can be interpolated! |
86 | if (property_from.dash_length != property_to.dash_length) | ||
87 | return EINA_FALSE; | ||
82 | 88 | ||
83 | if (property_to.dash_length) | 89 | if (property_to.dash_length) |
84 | { | 90 | { |
@@ -94,35 +100,39 @@ _efl_gfx_shape_efl_gfx_path_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd, | |||
94 | } | 100 | } |
95 | } | 101 | } |
96 | 102 | ||
97 | efl_gfx_shape_stroke_scale_set(obj, interpolate(property_from.scale, | 103 | interv = interpolate(property_from.scale, property_to.scale, pos_map); |
98 | property_to.scale, pos_map)); | 104 | efl_gfx_shape_stroke_scale_set(obj, interv); |
105 | |||
99 | efl_gfx_shape_stroke_color_set(obj, | 106 | efl_gfx_shape_stroke_color_set(obj, |
100 | interpolatei(property_from.r, | 107 | interpolatei(property_from.r, property_to.r, |
101 | property_to.r, pos_map), | 108 | pos_map), |
102 | interpolatei(property_from.g, | 109 | interpolatei(property_from.g, property_to.g, |
103 | property_to.g, pos_map), | 110 | pos_map), |
104 | interpolatei(property_from.b, | 111 | interpolatei(property_from.b, property_to.b, |
105 | property_to.b, pos_map), | 112 | pos_map), |
106 | interpolatei(property_from.a, | 113 | interpolatei(property_from.a, property_to.a, |
107 | property_to.a, pos_map)); | 114 | pos_map)); |
115 | //Color is not a part of Path. Is it correct?... | ||
108 | efl_gfx_color_set(obj, | 116 | efl_gfx_color_set(obj, |
109 | interpolatei(property_from.fr, property_to.fr, pos_map), | 117 | interpolatei(property_from.fr, property_to.fr, pos_map), |
110 | interpolatei(property_from.fg, property_to.fg, pos_map), | 118 | interpolatei(property_from.fg, property_to.fg, pos_map), |
111 | interpolatei(property_from.fb, property_to.fb, pos_map), | 119 | interpolatei(property_from.fb, property_to.fb, pos_map), |
112 | interpolatei(property_from.fa, property_to.fa, pos_map)); | 120 | interpolatei(property_from.fa, property_to.fa, pos_map)); |
113 | 121 | ||
114 | efl_gfx_shape_stroke_width_set(obj, interpolate(property_from.w, | 122 | interv = interpolate(property_from.w, property_to.w, pos_map); |
115 | property_to.w, pos_map)); | 123 | efl_gfx_shape_stroke_width_set(obj, interv); |
116 | efl_gfx_shape_stroke_location_set(obj, interpolate(property_from.centered, | 124 | |
117 | property_to.centered, | 125 | interv = interpolate(property_from.centered, property_to.centered, pos_map); |
118 | pos_map)); | 126 | efl_gfx_shape_stroke_location_set(obj, interv); |
127 | |||
119 | efl_gfx_shape_stroke_dash_set(obj, dash, property_to.dash_length); | 128 | efl_gfx_shape_stroke_dash_set(obj, dash, property_to.dash_length); |
120 | efl_gfx_shape_stroke_cap_set(obj, (pos_map < 0.5) ? | 129 | efl_gfx_shape_stroke_cap_set(obj, (pos_map < 0.5) ? |
121 | property_from.c : property_to.c); | 130 | property_from.c : property_to.c); |
122 | efl_gfx_shape_stroke_join_set(obj, (pos_map < 0.5) ? | 131 | efl_gfx_shape_stroke_join_set(obj, (pos_map < 0.5) ? |
123 | property_from.j : property_to.j); | 132 | property_from.j : property_to.j); |
124 | 133 | ||
125 | return efl_gfx_path_interpolate(efl_super(obj, MY_CLASS), from, to, pos_map); | 134 | return efl_gfx_path_interpolate(efl_cast(obj, EFL_GFX_PATH_MIXIN), |
135 | from, to, pos_map); | ||
126 | } | 136 | } |
127 | 137 | ||
128 | EOLIAN static void | 138 | EOLIAN static void |