mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-11 11:29:03 +08:00
Fix drawRect with NaN when drawing borders in Nodes
Summary: drawRect was sometimes being called with NaN values, which caused very strange ui behavior on some devices. This patch fixes the problem by ensuring that we use a default value when the value is NaN. Reviewed By: AaaChiuuu Differential Revision: D4338453
This commit is contained in:
@@ -407,7 +407,7 @@ import com.facebook.react.uimanager.Spacing;
|
||||
}
|
||||
|
||||
private static float resolveWidth(float width, float defaultWidth) {
|
||||
return width == 0 ? defaultWidth : width;
|
||||
return (width == 0 || /* check for NaN */ width != width) ? defaultWidth : width;
|
||||
}
|
||||
|
||||
private static DashPathEffect createDashPathEffect(float borderWidth) {
|
||||
|
||||
Reference in New Issue
Block a user