summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-04 20:11:43 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-07 13:20:54 +0200
commit8ae4dbfb3f63b61d1f08a1fc983d59c742011093 (patch)
tree4fb321bf432c80b45da0041ea6afc0fc4e8a81cd
parent66010e5a9f29e3f50adbe5f58c440ff1521d99c6 (diff)
efl_ui_active_view: fix view_manager_scroll
the problem that can be observed when clicking permanently on a view in the view_manager_scroll. You will see things jump arround uncontrolled, then when you quickly drag and drop, you will also see a lot of weird moving arround artifacts. The reason for this is, that progress was not correctly resetted, additionally, mouse_active also was not resetted correctly in one case. fix T7988 Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com> Differential Revision: https://phab.enlightenment.org/D9074
-rw-r--r--src/lib/elementary/efl_ui_active_view_view_manager_scroll.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_ui_active_view_view_manager_scroll.c b/src/lib/elementary/efl_ui_active_view_view_manager_scroll.c
index 975a5df5d1..6918703cf1 100644
--- a/src/lib/elementary/efl_ui_active_view_view_manager_scroll.c
+++ b/src/lib/elementary/efl_ui_active_view_view_manager_scroll.c
@@ -226,6 +226,7 @@ _page_set_animation(void *data, const Efl_Event *event EINA_UNUSED)
226 efl_event_callback_del(pd->container, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, 226 efl_event_callback_del(pd->container, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK,
227 _page_set_animation, data); 227 _page_set_animation, data);
228 pd->transition.active = EINA_FALSE; 228 pd->transition.active = EINA_FALSE;
229 pd->transition.progress = 0.0;
229 } 230 }
230 _apply_box_properties(data, pd); 231 _apply_box_properties(data, pd);
231} 232}
@@ -237,8 +238,12 @@ _animation_request_switch(Eo *obj, Efl_Ui_Active_View_View_Manager_Scroll_Data *
237 if (pd->transition.active && !pd->mouse_move.active && pd->transition.to == to) 238 if (pd->transition.active && !pd->mouse_move.active && pd->transition.to == to)
238 return; 239 return;
239 240
240 if (!pd->transition.active && !pd->mouse_move.active && from == to) 241 //In case there is no transition but from and to are the same, ensure that we reset the mouse_move state, and return.
241 return; 242 if (!pd->transition.active && from == to)
243 {
244 pd->mouse_move.active = EINA_FALSE;
245 return;
246 }
242 247
243 efl_event_callback_del(pd->container, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, obj); 248 efl_event_callback_del(pd->container, EFL_CANVAS_OBJECT_EVENT_ANIMATOR_TICK, _page_set_animation, obj);
244 //if there is a ongoing transition, try to guess a better time, and try copy over the position where we are right now 249 //if there is a ongoing transition, try to guess a better time, and try copy over the position where we are right now
@@ -247,13 +252,14 @@ _animation_request_switch(Eo *obj, Efl_Ui_Active_View_View_Manager_Scroll_Data *
247 pd->transition.from = MIN(pd->transition.from, pd->transition.to) + pd->transition.progress; 252 pd->transition.from = MIN(pd->transition.from, pd->transition.to) + pd->transition.progress;
248 pd->transition.max_time = MIN(MAX(fabs(pd->transition.progress), 0.2), 0.5f); 253 pd->transition.max_time = MIN(MAX(fabs(pd->transition.progress), 0.2), 0.5f);
249 pd->mouse_move.active = EINA_FALSE; 254 pd->mouse_move.active = EINA_FALSE;
250 pd->transition.progress = 0.0f;
251 } 255 }
252 else 256 else
253 { 257 {
254 pd->transition.from = from; 258 pd->transition.from = from;
255 pd->transition.max_time = 0.5; 259 pd->transition.max_time = 0.5;
260 pd->transition.progress = 0.0;
256 } 261 }
262
257 pd->transition.start_time = ecore_loop_time_get(); 263 pd->transition.start_time = ecore_loop_time_get();
258 pd->transition.active = EINA_TRUE; 264 pd->transition.active = EINA_TRUE;
259 pd->transition.to = to; 265 pd->transition.to = to;
@@ -271,6 +277,7 @@ _efl_ui_active_view_view_manager_scroll_efl_ui_active_view_view_manager_switch_t
271 { 277 {
272 pd->mouse_move.active = EINA_FALSE; 278 pd->mouse_move.active = EINA_FALSE;
273 pd->transition.active = EINA_FALSE; 279 pd->transition.active = EINA_FALSE;
280 pd->transition.progress = 0.0;
274 _apply_box_properties(obj, pd); 281 _apply_box_properties(obj, pd);
275 } 282 }
276} 283}