Lines Matching full:if
49 if(indev->pointer.vect.x == 0 && indev->pointer.vect.y == 0) { in lv_indev_scroll_handler()
54 /*If there is no scroll object yet try to find one*/ in lv_indev_scroll_handler()
55 if(scroll_obj == NULL) { in lv_indev_scroll_handler()
57 if(scroll_obj == NULL) return; in lv_indev_scroll_handler()
63 if(indev->reset_query) return; in lv_indev_scroll_handler()
66 /*Set new position or scroll if the vector is not zero*/ in lv_indev_scroll_handler()
80 if(scale_x == 0) { in lv_indev_scroll_handler()
84 if(scale_y == 0) { in lv_indev_scroll_handler()
88 if(angle != 0 || scale_x != LV_SCALE_NONE || scale_y != LV_SCALE_NONE) { in lv_indev_scroll_handler()
98 if(indev->pointer.scroll_dir == LV_DIR_HOR) { in lv_indev_scroll_handler()
110 if((scroll_dir & LV_DIR_LEFT) == 0 && diff_x > 0) diff_x = 0; in lv_indev_scroll_handler()
111 if((scroll_dir & LV_DIR_RIGHT) == 0 && diff_x < 0) diff_x = 0; in lv_indev_scroll_handler()
112 if((scroll_dir & LV_DIR_TOP) == 0 && diff_y > 0) diff_y = 0; in lv_indev_scroll_handler()
113 if((scroll_dir & LV_DIR_BOTTOM) == 0 && diff_y < 0) diff_y = 0; in lv_indev_scroll_handler()
119 if(indev->reset_query) return; in lv_indev_scroll_handler()
127 if(scroll_obj == NULL) return; in lv_indev_scroll_throw_handler()
128 if(indev->pointer.scroll_dir == LV_DIR_NONE) return; in lv_indev_scroll_throw_handler()
132 if(lv_obj_has_flag(scroll_obj, LV_OBJ_FLAG_SCROLL_MOMENTUM) == false) { in lv_indev_scroll_throw_handler()
140 if(indev->pointer.scroll_dir == LV_DIR_VER) { in lv_indev_scroll_throw_handler()
142 /*If no snapping "throw"*/ in lv_indev_scroll_throw_handler()
143 if(align_y == LV_SCROLL_SNAP_NONE) { in lv_indev_scroll_throw_handler()
154 if(indev->reset_query) return; in lv_indev_scroll_throw_handler()
163 if(indev->reset_query) return; in lv_indev_scroll_throw_handler()
166 else if(indev->pointer.scroll_dir == LV_DIR_HOR) { in lv_indev_scroll_throw_handler()
168 /*If no snapping "throw"*/ in lv_indev_scroll_throw_handler()
169 if(align_x == LV_SCROLL_SNAP_NONE) { in lv_indev_scroll_throw_handler()
180 if(indev->reset_query) return; in lv_indev_scroll_throw_handler()
189 if(indev->reset_query) return; in lv_indev_scroll_throw_handler()
193 /*Check if the scroll has finished*/ in lv_indev_scroll_throw_handler()
194 if(indev->pointer.scroll_throw_vect.x == 0 && indev->pointer.scroll_throw_vect.y == 0) { in lv_indev_scroll_throw_handler()
195 /*Revert if scrolled in*/ in lv_indev_scroll_throw_handler()
196 /*If vertically scrollable and not controlled by snap*/ in lv_indev_scroll_throw_handler()
197 if(align_y == LV_SCROLL_SNAP_NONE) { in lv_indev_scroll_throw_handler()
200 if(st > 0 || sb > 0) { in lv_indev_scroll_throw_handler()
201 if(st < 0) { in lv_indev_scroll_throw_handler()
203 if(indev->reset_query) return; in lv_indev_scroll_throw_handler()
205 else if(sb < 0) { in lv_indev_scroll_throw_handler()
207 if(indev->reset_query) return; in lv_indev_scroll_throw_handler()
212 /*If horizontally scrollable and not controlled by snap*/ in lv_indev_scroll_throw_handler()
213 if(align_x == LV_SCROLL_SNAP_NONE) { in lv_indev_scroll_throw_handler()
216 if(sl > 0 || sr > 0) { in lv_indev_scroll_throw_handler()
217 if(sl < 0) { in lv_indev_scroll_throw_handler()
219 if(indev->reset_query) return; in lv_indev_scroll_throw_handler()
221 else if(sr < 0) { in lv_indev_scroll_throw_handler()
223 if(indev->reset_query) return; in lv_indev_scroll_throw_handler()
229 if(indev->reset_query) return; in lv_indev_scroll_throw_handler()
238 if(indev == NULL) return 0; in lv_indev_scroll_throw_predict()
277 * 3. If an object can be scrolled into the current direction then use it ("real match"") in lv_indev_find_scroll_obj()
278 …* 4. If can be scrolled on the current axis (hor/ver) save it as candidate (at least show an elast… in lv_indev_find_scroll_obj()
282 /*Decide if it's a horizontal or vertical scroll*/ in lv_indev_find_scroll_obj()
304 if(scale_x == 0) { in lv_indev_find_scroll_obj()
308 if(scale_y == 0) { in lv_indev_find_scroll_obj()
313 if(angle != 0 || scale_x != LV_SCALE_NONE || scale_y != LV_SCALE_NONE) { in lv_indev_find_scroll_obj()
320 if(LV_ABS(obj_scroll_sum.x) > LV_ABS(obj_scroll_sum.y)) { in lv_indev_find_scroll_obj()
327 if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLLABLE) == false) { in lv_indev_find_scroll_obj()
328 /*If this object don't want to chain the scroll to the parent stop searching*/ in lv_indev_find_scroll_obj()
329 if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_HOR) == false && hor_en) break; in lv_indev_find_scroll_obj()
330 if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_VER) == false && ver_en) break; in lv_indev_find_scroll_obj()
344 if((scroll_dir & LV_DIR_LEFT) == 0) left_en = false; in lv_indev_find_scroll_obj()
345 if((scroll_dir & LV_DIR_RIGHT) == 0) right_en = false; in lv_indev_find_scroll_obj()
346 if((scroll_dir & LV_DIR_TOP) == 0) up_en = false; in lv_indev_find_scroll_obj()
347 if((scroll_dir & LV_DIR_BOTTOM) == 0) down_en = false; in lv_indev_find_scroll_obj()
353 if(snap_x == LV_SCROLL_SNAP_NONE) { in lv_indev_find_scroll_obj()
363 *Assumed scroll in if there are NO more nap points*/ in lv_indev_find_scroll_obj()
372 if(snap_y == LV_SCROLL_SNAP_NONE) { in lv_indev_find_scroll_obj()
382 *Assumed scroll in if there are NO more nap points*/ in lv_indev_find_scroll_obj()
387 … /*If this object is scrollable into the current scroll direction then save it as a candidate. in lv_indev_find_scroll_obj()
388 *It's important only to be scrollable on the current axis (hor/ver) because if the scroll in lv_indev_find_scroll_obj()
390 *But if not hor/ver scrollable do not scroll it at all (so it's not a good candidate)*/ in lv_indev_find_scroll_obj()
391 if((st > 0 || sb > 0) && in lv_indev_find_scroll_obj()
398 if((sl > 0 || sr > 0) && in lv_indev_find_scroll_obj()
405 if(st <= 0) up_en = false; in lv_indev_find_scroll_obj()
406 if(sb <= 0) down_en = false; in lv_indev_find_scroll_obj()
407 if(sl <= 0) left_en = false; in lv_indev_find_scroll_obj()
408 if(sr <= 0) right_en = false; in lv_indev_find_scroll_obj()
410 /*If the object really can be scrolled into the current direction then use it.*/ in lv_indev_find_scroll_obj()
411 if((left_en && obj_scroll_sum.x >= scroll_limit) || in lv_indev_find_scroll_obj()
419 /*If this object don't want to chain the scroll to the parent stop searching*/ in lv_indev_find_scroll_obj()
420 if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_HOR) == false && hor_en) break; in lv_indev_find_scroll_obj()
421 if(lv_obj_has_flag(obj_act, LV_OBJ_FLAG_SCROLL_CHAIN_VER) == false && ver_en) break; in lv_indev_find_scroll_obj()
428 if(obj_candidate) { in lv_indev_find_scroll_obj()
445 /*If there no STOP allow scrolling anywhere*/ in init_scroll_limits()
446 if(lv_obj_has_flag(obj, LV_OBJ_FLAG_SCROLL_ONE) == false) { in init_scroll_limits()
496 if(indev->pointer.scroll_area.x1 == LV_COORD_MAX) indev->pointer.scroll_area.x1 = LV_COORD_MIN; in init_scroll_limits()
497 if(indev->pointer.scroll_area.y1 == LV_COORD_MAX) indev->pointer.scroll_area.y1 = LV_COORD_MIN; in init_scroll_limits()
500 if(indev->pointer.scroll_area.x1 == 0) indev->pointer.scroll_area.x1 = LV_COORD_MIN; in init_scroll_limits()
501 if(indev->pointer.scroll_area.x2 == 0) indev->pointer.scroll_area.x2 = LV_COORD_MAX; in init_scroll_limits()
502 if(indev->pointer.scroll_area.y1 == 0) indev->pointer.scroll_area.y1 = LV_COORD_MIN; in init_scroll_limits()
503 if(indev->pointer.scroll_area.y2 == 0) indev->pointer.scroll_area.y2 = LV_COORD_MAX; in init_scroll_limits()
512 * what if children are already moved by this value
514 * or `LV_COORD_MAX` if there is no snap point in the min..max range
519 if(align == LV_SCROLL_SNAP_NONE) return LV_COORD_MAX; in find_snap_point_x()
530 if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; in find_snap_point_x()
531 if(lv_obj_has_flag(child, LV_OBJ_FLAG_SNAPPABLE)) { in find_snap_point_x()
552 if(x_child >= min && x_child <= max) { in find_snap_point_x()
554 if(LV_ABS(x) < LV_ABS(dist)) dist = x; in find_snap_point_x()
568 * what if children are already moved by this value
570 * or `LV_COORD_MAX` if there is no snap point in the min..max range
575 if(align == LV_SCROLL_SNAP_NONE) return LV_COORD_MAX; in find_snap_point_y()
586 if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue; in find_snap_point_y()
587 if(lv_obj_has_flag(child, LV_OBJ_FLAG_SNAPPABLE)) { in find_snap_point_y()
608 if(y_child >= min && y_child <= max) { in find_snap_point_y()
610 if(LV_ABS(y) < LV_ABS(dist)) dist = y; in find_snap_point_y()
620 if(diff_y) { in scroll_limit_diff()
621 if(indev->pointer.scroll_sum.y + *diff_y < indev->pointer.scroll_area.y1) { in scroll_limit_diff()
625 if(indev->pointer.scroll_sum.y + *diff_y > indev->pointer.scroll_area.y2) { in scroll_limit_diff()
630 if(diff_x) { in scroll_limit_diff()
631 if(indev->pointer.scroll_sum.x + *diff_x < indev->pointer.scroll_area.x1) { in scroll_limit_diff()
635 if(indev->pointer.scroll_sum.x + *diff_x > indev->pointer.scroll_area.x2) { in scroll_limit_diff()
644 if(diff == 0) return 0; in elastic_diff()
646 /*Scroll back to the edge if required*/ in elastic_diff()
647 if(!lv_obj_has_flag(scroll_obj, LV_OBJ_FLAG_SCROLL_ELASTIC)) { in elastic_diff()
649 * If the scrolling object does not set the `LV_OBJ_FLAG_SCROLL_ELASTIC` flag, in elastic_diff()
651 … * If the content has exceeded the boundary due to external factors like `LV_SCROLL_SNAP_CENTER`, in elastic_diff()
655 if(scroll_ended < 0) diff = 0; in elastic_diff()
656 else if(scroll_ended - diff < 0) diff = scroll_ended; in elastic_diff()
665 if(snap == LV_SCROLL_SNAP_NONE) { in elastic_diff()
666 if(scroll_end < 0 || scroll_start < 0) { in elastic_diff()
668 if(diff < 0) diff -= ELASTIC_SLOWNESS_FACTOR / 2; in elastic_diff()
669 if(diff > 0) diff += ELASTIC_SLOWNESS_FACTOR / 2; in elastic_diff()
677 /*With snapping the widget is scrolled out if there are no more snap points in elastic_diff()
683 if(!has_start_snap || !has_end_snap) { in elastic_diff()
685 if(diff < 0) diff -= ELASTIC_SLOWNESS_FACTOR / 2; in elastic_diff()
686 if(diff > 0) diff += ELASTIC_SLOWNESS_FACTOR / 2; in elastic_diff()
699 * There is a snap point if there is a snapanble object in the given direction
716 if(dir == LV_DIR_HOR) { in has_more_snap_points()
738 if(d == LV_COORD_MAX) *has_end_snap = false; in has_more_snap_points()
740 if(d == LV_COORD_MAX) *has_start_snap = false; in has_more_snap_points()
764 if(d == LV_COORD_MAX) *has_end_snap = false; in has_more_snap_points()
766 if(d == LV_COORD_MAX) *has_start_snap = false; in has_more_snap_points()