nui icon indicating copy to clipboard operation
nui copied to clipboard

Button with corner-radius clips button text

Open glentregoning opened this issue 10 years ago • 2 comments

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; }

screen shot 2014-08-07 at 12 27 23 pm

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.

glentregoning avatar Aug 07 '14 19:08 glentregoning

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.

glentregoning avatar Aug 07 '14 19:08 glentregoning

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.

mateagar avatar Mar 07 '17 18:03 mateagar