mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-06-19 21:29:36 +08:00
Fix triangle views on iOS (#23402)
Summary: Fixes #22824 #21945 , the bug comes from #21208 , it was to fix #11897. Now Let's constrain edge adjust only when view has corners. [iOS] [Fixed] - Fix triangle views on iOS Pull Request resolved: https://github.com/facebook/react-native/pull/23402 Differential Revision: D14059192 Pulled By: hramos fbshipit-source-id: be613bf056d3cc484f281f7ea3d08f251971700a
This commit is contained in:
committed by
Facebook Github Bot
parent
05c56edf41
commit
7a6fe0cda0
@@ -224,13 +224,15 @@ static UIImage *RCTGetSolidBorderImage(RCTCornerRadii cornerRadii,
|
||||
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),
|
||||
};
|
||||
if (hasCornerRadii) {
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user