Styles (radius/gradient) not drawn correctly


I am seeing some issues with some style properties of objects. The radius and gradient are not drawn at all. However, the properties seem to have been set correctly.
Other style properties (background color, border width/color) seem to work correctly.

I do not seem to find what causes this behavior. I have not manually set any default styles.
I don’t really know where else to look, or what mistakes I could be making.
Could anyone point me in the right direction?

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

ESP32 S3, TFT display X-NUCLEO-GFX01M1

What LVGL version are you using?


What do you want to achieve?

I want to draw a simple rectangle, having a radius.

What have you tried so far?

I tried setting the radius with lv_obj_set_style_radius(obj, value, 0).
After reading the property (lv_obj_get_style_radius), the value seems to be correct.
However, the rectangle on the screen does not show any radius whatsoever.

I also tried setting the radius by first defining a style:

static lv_style_t style;
lv_style_set_radius(&style, LV_RADIUS_CIRCLE);
lv_obj_add_style(obj, &style, 0);

This again results in no radius to be seen on the screen.

Code to reproduce

lv_obj_t* obj = lv_obj_create(lv_scr_act());
lv_obj_set_style_bg_color(obj, lv_color_hex(0xFF0000), 0);
lv_obj_set_style_radius(obj, LV_RADIUS_CIRCLE, 0);
lv_obj_set_style_border_color(obj, lv_color_black(), 0);
lv_obj_set_style_border_width(obj, 3, 0);

Expected result: Red circle with black border.
Seen: Red box (no rounding whatsoever), with black border.

Screenshot and/or video

Hi @jondhoor ,

It may be worth checking you have #define LV_DRAW_COMPLEX 1 set in your lv_conf.h.

Pasting your example code in the standard simulator gives the following result so your method looks good so it must be a configuration issue somewhere:

Kind Regards,


Hi Pete

Thank you for the quick reply.
It seems that LV_DRAW_COMPLEX is indeed set to 0 in my configuration.
Thank you!

Kind regards,

1 Like