Separate Node bounds and hit bounds within node region where needed.

Summary: Node region bounds are assumed to equal the underlying node bounds.  In the case of hit slop, these need to be abstracted.

Reviewed By: ahmedre

Differential Revision: D3713430
This commit is contained in:
Seth Kirby
2016-12-19 13:40:32 -08:00
committed by Ahmed El-Helw
parent a602891946
commit 4a12efad02
9 changed files with 169 additions and 48 deletions
@@ -356,12 +356,12 @@ import com.facebook.react.uimanager.UIViewOperationQueue;
}
int resultTag = region == NodeRegion.EMPTY ? touchTargetReactTag : region.mTag;
float x = PixelUtil.toDIPFromPixel(region.mLeft + MEASURE_BUFFER[0] - containerX);
float y = PixelUtil.toDIPFromPixel(region.mTop + MEASURE_BUFFER[1] - containerY);
float x = PixelUtil.toDIPFromPixel(region.getLeft() + MEASURE_BUFFER[0] - containerX);
float y = PixelUtil.toDIPFromPixel(region.getTop() + MEASURE_BUFFER[1] - containerY);
float width = PixelUtil.toDIPFromPixel(isNativeView ?
MEASURE_BUFFER[2] : region.mRight - region.mLeft);
MEASURE_BUFFER[2] : region.getRight() - region.getLeft());
float height = PixelUtil.toDIPFromPixel(isNativeView ?
MEASURE_BUFFER[3] : region.mBottom - region.mTop);
MEASURE_BUFFER[3] : region.getBottom() - region.getTop());
mCallback.invoke(resultTag, x, y, width, height);
}
}