How to create a custom border

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

WT32-SC01 Plus (ESP32-S2)

What LVGL version are you using?


What do you want to achieve?

I want to draw a custom border

What have you tried so far?

See below

Hi all,

I’m new to LGVL, but it’s been fairly straight forward so far (awesome package BTW). I have designed a gui for my application, which is just a couple of flex containers each containing a variety of flex children. The children are dynamic, they will come and go as needed, and since I use flex-grow, that means that the size of each of the children will change as other children are added or deleted.

I want to draw a more futuristic border around each of the children, instead of the standard rounded-rectangle. If the children were statically sized, it would be straight forward to achieve this using lv_line. If tried to do this by changing the line coordinates at runtme, based on the width of the child from lv_obj_get_width, but that messes things up. The other way I can think of doing this is by creating images for the 4 corners, and drawing lines between them, but I would prefer to do this programatically if possible.

Does anyone have any hints as to how I might go about this please?

Please ignore, I figured out how to do it using lv_line afterall, I just had an error in my logic.