How to implement a button with straight clipped corners

What LVGL version are you using?


What do you want to achieve?

I’d like to have buttons with clipped straight corners, as in the following (drawn) example:


In the example the button has all four corners clipped, but in several instances I should be able to clip any arbitrary corner while leaving the rest as they would be normally.

I imagine it should be possible with masking but I’d like to ask for some guidance if possible.