I extended my rounded corners implementation to add the ability enable/disable individual sides of the border, set in the new struct
BorderStyle. The draw function isn't pretty but after several attempts this "manual" mapping method is the most efficient I could think of. On the plus side it simplifies the element code by automatically figuring out which corners need to be connected and rounded.
One way to make it more modular in the future could be to move the rounded corners, LineStyle, [and fill color] into a separate RoundedRectangle shape struct for reuse in the shapes drawing feature
My idea for the API is:
- Create a new
RoundedCornersstruct similar to
Marginsthat can be constructed from a single value for all four corners, or from four different corners.
newis the only constructor and that there are these setters:
I see that you made it possible to select which borders to draw. This could be fitted in this model by creating a
Bordersstruct with four boolean values (again similar to
If it makes sense for the implementation (for example to reduce the number of arguments in the draw methods), you can combine these settings in a
FrameStylestruct. But this should be an implementation detail of the
FramedElementand not directly exposed to the user.
Does that make sense to you? If yes, please submit the patches.
is set_fill_color / with_fill_color for FrameCellDecorator implemented? If yes, can you please share a sample