diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSBubbleView.m index 33a74a10a..c8f3acf69 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSBubbleView.m @@ -175,27 +175,32 @@ const CGFloat kBubbleTextVInset = 10.f; [bezierPath addQuadCurveToPoint:CGPointMake(bubbleRight, bubbleTop + kBubbleVRounding) controlPoint:CGPointMake(bubbleRight, bubbleTop)]; [bezierPath addLineToPoint:CGPointMake(bubbleRight, bubbleBottom - kBubbleVRounding)]; - [bezierPath addQuadCurveToPoint:CGPointMake(bubbleRight - kBubbleHRounding, bubbleBottom) - controlPoint:CGPointMake(bubbleRight, bubbleBottom)]; - [bezierPath addLineToPoint:CGPointMake(bubbleLeft + kBubbleHRounding, bubbleBottom)]; - [bezierPath addQuadCurveToPoint:CGPointMake(bubbleLeft, bubbleBottom - kBubbleVRounding) - controlPoint:CGPointMake(bubbleLeft, bubbleBottom)]; - [bezierPath addLineToPoint:CGPointMake(bubbleLeft, bubbleTop + kBubbleVRounding)]; - [bezierPath addQuadCurveToPoint:CGPointMake(bubbleLeft + kBubbleHRounding, bubbleTop) - controlPoint:CGPointMake(bubbleLeft, bubbleTop)]; - if (!hideTail) { + if (hideTail) { + [bezierPath addQuadCurveToPoint:CGPointMake(bubbleRight - kBubbleHRounding, bubbleBottom) + controlPoint:CGPointMake(bubbleRight, bubbleBottom)]; + } else { // Thorn Tip CGPoint thornTip = CGPointMake(size.width + 1, size.height); - CGPoint thornA = CGPointMake(bubbleRight - kBubbleHRounding * 0.5f, bubbleBottom - kBubbleVRounding); CGPoint thornB = CGPointMake(bubbleRight, bubbleBottom - kBubbleVRounding); - [bezierPath moveToPoint:thornTip]; - [bezierPath addQuadCurveToPoint:thornA controlPoint:CGPointMake(thornA.x, bubbleBottom)]; - [bezierPath addLineToPoint:thornB]; + // Approximate intersection of the thorn and the bubble edge. + CGPoint thornPrime + = CGPointMake(bubbleRight - kBubbleHRounding * 0.25f, bubbleBottom - kBubbleVRounding * 0.25f); + CGPoint thornPrimeA = CGPointMake(thornPrime.x, bubbleBottom - kBubbleVRounding * 0.08f); + [bezierPath addQuadCurveToPoint:thornTip controlPoint:CGPointMake(thornB.x, bubbleBottom)]; - [bezierPath addLineToPoint:thornTip]; + [bezierPath addQuadCurveToPoint:thornPrime controlPoint:thornPrimeA]; + [bezierPath addQuadCurveToPoint:CGPointMake(bubbleRight - kBubbleHRounding, bubbleBottom) + controlPoint:thornPrimeA]; } + [bezierPath addLineToPoint:CGPointMake(bubbleLeft + kBubbleHRounding, bubbleBottom)]; + [bezierPath addQuadCurveToPoint:CGPointMake(bubbleLeft, bubbleBottom - kBubbleVRounding) + controlPoint:CGPointMake(bubbleLeft, bubbleBottom)]; + [bezierPath addLineToPoint:CGPointMake(bubbleLeft, bubbleTop + kBubbleVRounding)]; + [bezierPath addQuadCurveToPoint:CGPointMake(bubbleLeft + kBubbleHRounding, bubbleTop) + controlPoint:CGPointMake(bubbleLeft, bubbleTop)]; + // Horizontal Flip If Necessary BOOL shouldFlip = isOutgoing == isRTL; if (shouldFlip) {