Using about lv_obj_align_x and lv_obj_align_y in V8


There is some code as follow in V7:

lv_obj_align_x(target_obj,  obj_one,  LV_ALIGN_IN_TOP_LEFT, 20);
lv_obj_align_y(target_obj,  obj_two,  LV_ALIGN_IN_TOP_LEFT, 30);

It is very simple for user to make target_obj align to obj_one in X direction and make target_obj align to obj_two in Y direction. In V8, is there any easy way to make one obj align to different objs(such as obj_one and obj_two) in x and y directions?

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

What LVGL version are you using?


What do you want to achieve?

What have you tried so far?

Maybe we can try the following function to achieve it. But it need us to do extra work(calculating the relative position of base and parent of obj).

void lv_obj_align_to(struct _lv_obj_t * obj, const struct _lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs);

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.