mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-09 17:30:58 +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.JSApplicationIllegalArgumentException;
|
||||||
import com.facebook.react.bridge.JavaOnlyArray;
|
import com.facebook.react.bridge.JavaOnlyArray;
|
||||||
import com.facebook.react.bridge.ReadableArray;
|
import com.facebook.react.bridge.ReadableArray;
|
||||||
import com.facebook.react.bridge.ReadableMap;
|
|
||||||
import com.facebook.react.bridge.ReadableType;
|
import com.facebook.react.bridge.ReadableType;
|
||||||
import com.facebook.react.bridge.WritableArray;
|
import com.facebook.react.bridge.WritableArray;
|
||||||
import com.facebook.react.uimanager.annotations.ReactProp;
|
import com.facebook.react.uimanager.annotations.ReactProp;
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ public class SvgViewShadowNode extends LayoutShadowNode {
|
|||||||
Bitmap drawOutput() {
|
Bitmap drawOutput() {
|
||||||
float width = getLayoutWidth();
|
float width = getLayoutWidth();
|
||||||
float height = getLayoutHeight();
|
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) {
|
if (early) {
|
||||||
ReactShadowNodeImpl parent = getParent();
|
ReactShadowNodeImpl parent = getParent();
|
||||||
float parentWidth = parent == null ? 0 : parent.getLayoutWidth();
|
float parentWidth = parent == null ? 0 : parent.getLayoutWidth();
|
||||||
@@ -240,11 +240,12 @@ public class SvgViewShadowNode extends LayoutShadowNode {
|
|||||||
int count = getChildCount();
|
int count = getChildCount();
|
||||||
int viewTag = -1;
|
int viewTag = -1;
|
||||||
for (int i = count - 1; i >= 0; i--) {
|
for (int i = count - 1; i >= 0; i--) {
|
||||||
if (!(getChildAt(i) instanceof VirtualNode)) {
|
ReactShadowNodeImpl child = getChildAt(i);
|
||||||
|
if (!(child instanceof VirtualNode)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
viewTag = ((VirtualNode) getChildAt(i)).hitTest(transformed);
|
viewTag = ((VirtualNode) child).hitTest(transformed);
|
||||||
if (viewTag != -1) {
|
if (viewTag != -1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user