Shaddow effect should clamp?

I’m testing Shadow effect on the corner of the window and I get this result:

image

this is the style I’m using:

	lv_style_init( &s_style_darkshadow );
	lv_style_set_shadow_color(&s_style_darkshadow, lv_color_make(0, 0, 0));
	lv_style_set_shadow_width(&s_style_darkshadow, LV_DPX(16));
	lv_style_set_shadow_opa(&s_style_darkshadow, LV_OPA_100);
	lv_style_set_shadow_ofs_x(&s_style_darkshadow, 0);
	lv_style_set_shadow_ofs_y(&s_style_darkshadow, 0);
	lv_style_set_shadow_spread(&s_style_darkshadow, 0);

I was expecting (at least on this case) to see the blur to continue but it looks is bluring to background (and not clamp the position)

Is this by design? Could it be a request feature? :slight_smile:

I can confirm that it’s feature, not a bug :smiley:

LVGL clips all the children to the parent’s coordinates. For v8.2 I’m planning to add an option to disable it.

ok nice! but it looks that in this case, it is considering the color outside screen is white (transparent?) or you could clamp to the same color as it is.

Wish:
color = (x >= MAX_X) ? buffer[MAX_X-1] : buffer[x]

at moment it looks like:
color = (x >= MAX_X) ? white or transparent color: buffer[x]

From which part or pixel do you see it considers the clipped part white or transparent? I believe that the clipped parts shouldn’t matter at all.

I made this montage with enhanced contrast. Left image is the current result, right image my wish:

image

Ah, it’s just because the radius starts to “bend” the shadow. (It’s like a movie title, “The shadow bender” :smiley: )

Try to position the button a little bit out of the parent in top-right direction to have this artifact clipped too.

1 Like