How to set the control not to be dragged out of bounds?

Description

How to set the control not to be dragged out of bounds?

What MCU/Processor/Board and compiler are you using?

What LVGL version are you using?

7.0

What do you want to achieve?

Allows a control to be dragged only in the parent control region

What have you tried so far?

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:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

I think you can do it by registering a signal handler, catching LV_SIGNAL_COORD_CHG, and checking whether the object has been moved out of the page. If it has, you should move it back to the appropriate edge.

OK Thanks…