Important: unclear posts may not receive useful answers.
Before posting
- Get familiar with Markdown to format and structure your post
- Be sure to update lvgl from the latest version from the
master
branch.- Be sure you have checked the FAQ and read the relevant part of the documentation.
- If applicable use the Simulator to eliminate hardware related issues.
Delete this section if you read and applied the mentioned points.
Description
The current behavior is that if the scrolling is less than the size of one item, it gets attracted to the center position, causing a jittering effect. For a knob, if the scrolling pixel distance can be calculated, it will not scroll if it’s less than one item, but it will scroll by whole items if it’s more than one or several items, thereby achieving a stepping effect, which can provide a better user experience.
What MCU/Processor/Board and compiler are you using?
BES2700BP
What LVGL version are you using?
LVGL 8.3.10
What do you want to achieve?
Is it possible to modify the scroll function implementation, or do you have any better suggestions?
What have you tried so far?
Walk through the scrolling code and try to understand its logic.
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
lv_result_t _lv_obj_scroll_by_raw(lv_obj_t * obj, int32_t x, int32_t y)
{
if(x == 0 && y == 0) return LV_RESULT_OK;
lv_obj_allocate_spec_attr(obj);
obj->spec_attr->scroll.x += x;
obj->spec_attr->scroll.y += y;
lv_obj_move_children_by(obj, x, y, true);
lv_result_t res = lv_obj_send_event(obj, LV_EVENT_SCROLL, NULL);
if(res != LV_RESULT_OK) return res;
lv_obj_invalidate(obj);
return LV_RESULT_OK;
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.