diff --git a/React/Views/RCTBorderDrawing.m b/React/Views/RCTBorderDrawing.m index b008dd05bf40f3..2a8d105471aa2a 100644 --- a/React/Views/RCTBorderDrawing.m +++ b/React/Views/RCTBorderDrawing.m @@ -217,13 +217,21 @@ static CGContextRef RCTUIGraphicsBeginImageContext(CGSize size, CGColorRef backg (borderInsets.top + cornerInsets.topRight.height + borderInsets.bottom + cornerInsets.bottomLeft.height <= viewSize.height); - const UIEdgeInsets edgeInsets = (UIEdgeInsets){ + UIEdgeInsets edgeInsets = (UIEdgeInsets){ borderInsets.top + MAX(cornerInsets.topLeft.height, cornerInsets.topRight.height), borderInsets.left + MAX(cornerInsets.topLeft.width, cornerInsets.bottomLeft.width), borderInsets.bottom + MAX(cornerInsets.bottomLeft.height, cornerInsets.bottomRight.height), borderInsets.right + MAX(cornerInsets.bottomRight.width, cornerInsets.topRight.width) }; + // Asymmetrical edgeInsets cause strange artifacting on iOS 10 and earlier. + edgeInsets = (UIEdgeInsets){ + MAX(edgeInsets.top, edgeInsets.bottom), + MAX(edgeInsets.left, edgeInsets.right), + MAX(edgeInsets.top, edgeInsets.bottom), + MAX(edgeInsets.left, edgeInsets.right), + }; + const CGSize size = makeStretchable ? (CGSize){ // 1pt for the middle stretchable area along each axis edgeInsets.left + 1 + edgeInsets.right,