Implement clipping rectangle for ReactNativeART

Reviewed By: sebmarkbage, taomin

Differential Revision: D3140869

fb-gh-sync-id: 0da27705c4cfca7a1fcae12eed11a7335a62631f
fbshipit-source-id: 0da27705c4cfca7a1fcae12eed11a7335a62631f
This commit is contained in:
Scott Foggo
2016-04-11 19:18:50 -07:00
committed by Facebook Github Bot 5
parent 0b534d1c3d
commit 24f03af0c3
5 changed files with 56 additions and 9 deletions

View File

@@ -227,13 +227,7 @@ var ClippingRectangle = React.createClass({
var y = extractNumber(props.y, 0);
var w = extractNumber(props.width, 0);
var h = extractNumber(props.height, 0);
var clipping = new Path()
.moveTo(x, y)
.line(w, 0)
.line(0, h)
.line(w, 0)
.close()
.toJSON();
var clipping = [x, y, w, h];
// The current clipping API requires x and y to be ignored in the transform
var propsExcludingXAndY = merge(props);
delete propsExcludingXAndY.x;