mirror of
https://github.com/status-im/react-native.git
synced 2025-02-27 16:40:38 +00: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:
parent
e9dba410eb
commit
761089211f
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user