mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 21:46:07 +08:00
Fix invalid CGContext when invalidate layer (#24195)
Summary: If size is zero, the `CGContext` would invalid, so we need to filter zero things. cc. shergin [iOS] [Fixed] - Fix invalid CGContext when invalidate layer Pull Request resolved: https://github.com/facebook/react-native/pull/24195 Differential Revision: D14683396 Pulled By: shergin fbshipit-source-id: b5b45fb86ca3158284281460cf1d95d1b22eab0d
This commit is contained in:
committed by
Facebook Github Bot
parent
a43e666a34
commit
b88cc7bf52
@@ -356,11 +356,15 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|||||||
|
|
||||||
- (void)invalidateLayer
|
- (void)invalidateLayer
|
||||||
{
|
{
|
||||||
|
CALayer *layer = self.layer;
|
||||||
|
|
||||||
|
if (CGSizeEqualToSize(layer.bounds.size, CGSizeZero)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto borderMetrics =
|
const auto borderMetrics =
|
||||||
_props->resolveBorderMetrics(_layoutMetrics.layoutDirection == LayoutDirection::RightToLeft);
|
_props->resolveBorderMetrics(_layoutMetrics.layoutDirection == LayoutDirection::RightToLeft);
|
||||||
|
|
||||||
CALayer *layer = self.layer;
|
|
||||||
|
|
||||||
// Stage 1. Shadow Path
|
// Stage 1. Shadow Path
|
||||||
BOOL layerHasShadow = layer.shadowOpacity > 0 && CGColorGetAlpha(layer.shadowColor) > 0;
|
BOOL layerHasShadow = layer.shadowOpacity > 0 && CGColorGetAlpha(layer.shadowColor) > 0;
|
||||||
if (layerHasShadow) {
|
if (layerHasShadow) {
|
||||||
|
|||||||
Reference in New Issue
Block a user