I'm trying to round the chat bubbles by applying bezierPathWithRoundedRect to them. Everything works almost perfect. But for some strange reason in some cases one of the corners seems to me much bigger than others. Why it happens and hou to avoid it?
My code:
bubbleContainer.layer.cornerRadius = 6.0;
UIRectCorner cornersOut = (UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomLeft);
UIRectCorner cornersIn = (UIRectCornerTopLeft | UIRectCornerTopRight | UIRectCornerBottomRight);
UIRectCorner corners = isOutMessage ? cornersOut : cornersIn;
UIBezierPath * maskPath = [UIBezierPath bezierPathWithRoundedRect:bubbleContainer.bounds byRoundingCorners:corners cornerRadii:CGSizeMake(17.0, 17.0)];
CAShapeLayer * maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = bubbleContainer.bounds;
maskLayer.path = maskPath.CGPath;
bubbleContainer.layer.mask = maskLayer;
As you can see, bubbles with text "111" and "1111" have a different top right corner. There is no other masking for bubbles and after applying tha mask bubbles do not resize.