nui
nui copied to clipboard
Button with corner-radius clips button text
When we style a button with a corner radius the text within it gets clipped on iOS7.1.
This isn't reproducible on iOS8.
E.g. my-custom-button { corner-radius: 14px; border-width: 1px; border-color: white; }
The root cause of this appears to be due to the NUIButtonRenderer applying corner radius values to all of it's sub-layers including the UIButton's internal UILabel.
Looking through the change history it appears as if this sub-layer application of corner-radius (and removal of layer.masksToBounds = YES) was introduced to allow shadow handling.
There is an issue with this change: masksToBounds is set to NO for the button's layer. This effectively wipes out the corner radius setting. I think this should only be set on the layer of the subview which corresponds to the label only.