diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeShadowNode.java index 0cfa1ce97dffc1..398ef70d5186e1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/art/ARTShapeShadowNode.java @@ -195,8 +195,8 @@ protected boolean setupFillPaint(Paint paint, float opacity) { case COLOR_TYPE_LINEAR_GRADIENT: // For mBrushData format refer to LinearGradient and insertColorStopsIntoArray functions in ReactNativeART.js if (mBrushData.length < 5) { - FLog.w(ReactConstants.TAG, - "[ARTShapeShadowNode setupFillPaint] expects 5 elements, received " + FLog.w(ReactConstants.TAG, + "[ARTShapeShadowNode setupFillPaint] expects 5 elements, received " + mBrushData.length); return false; } @@ -296,16 +296,16 @@ private Path createPath(float[] data) { float start = (float) Math.toDegrees(data[i++]); float end = (float) Math.toDegrees(data[i++]); - boolean clockwise = data[i++] == 1f; + boolean counterClockwise = !(data[i++] == 1f); float sweep = end - start; if (Math.abs(sweep) > 360) { sweep = 360; } else { sweep = modulus(sweep, 360); } - if (!clockwise && sweep < 360) { - start = end; - sweep = 360 - sweep; + if (counterClockwise && sweep < 360) { + // Counter-clockwise sweeps are negative + sweep = -1 * (360 - sweep); } RectF oval = new RectF(x - r, y - r, x + r, y + r);