mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-28 21:03:51 +00:00
Fix early predicate.
This commit is contained in:
@@ -21,7 +21,6 @@ import com.facebook.react.bridge.Dynamic;
|
||||
import com.facebook.react.bridge.JSApplicationIllegalArgumentException;
|
||||
import com.facebook.react.bridge.JavaOnlyArray;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.ReadableType;
|
||||
import com.facebook.react.bridge.WritableArray;
|
||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||
|
||||
@@ -130,7 +130,7 @@ public class SvgViewShadowNode extends LayoutShadowNode {
|
||||
Bitmap drawOutput() {
|
||||
float width = getLayoutWidth();
|
||||
float height = getLayoutHeight();
|
||||
boolean early = Float.isNaN(width) || Float.isNaN(height) || width * height == 0;
|
||||
boolean early = Float.isNaN(width) || Float.isNaN(height) || width * height == 0 || (Math.log10(width) + Math.log10(height) > 42);
|
||||
if (early) {
|
||||
ReactShadowNodeImpl parent = getParent();
|
||||
float parentWidth = parent == null ? 0 : parent.getLayoutWidth();
|
||||
@@ -240,11 +240,12 @@ public class SvgViewShadowNode extends LayoutShadowNode {
|
||||
int count = getChildCount();
|
||||
int viewTag = -1;
|
||||
for (int i = count - 1; i >= 0; i--) {
|
||||
if (!(getChildAt(i) instanceof VirtualNode)) {
|
||||
ReactShadowNodeImpl child = getChildAt(i);
|
||||
if (!(child instanceof VirtualNode)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
viewTag = ((VirtualNode) getChildAt(i)).hitTest(transformed);
|
||||
viewTag = ((VirtualNode) child).hitTest(transformed);
|
||||
if (viewTag != -1) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user