diff --git a/lottie/src/main/java/com/airbnb/lottie/ShapeLayer.java b/lottie/src/main/java/com/airbnb/lottie/ShapeLayer.java
index <HASH>..<HASH> 100644
--- a/lottie/src/main/java/com/airbnb/lottie/ShapeLayer.java
+++ b/lottie/src/main/java/com/airbnb/lottie/ShapeLayer.java
@@ -197,6 +197,15 @@ class ShapeLayer extends AnimatableLayer {
       newStart += currentPathStrokeOffset;
       newEnd += currentPathStrokeOffset;
 
+      // If the trim path has rotated around the path, we need to shift it back.
+      if (newStart > length && newEnd > length) {
+        newStart %= length;
+        newEnd %= length;
+      }
+      if (newStart > newEnd) {
+        newStart -= length;
+      }
+
       pathMeasure.getSegment(
           newStart,
           newEnd,
@@ -210,6 +219,12 @@ class ShapeLayer extends AnimatableLayer {
             newEnd % length,
             extraTrimPath,
             true);
+      } else if (newStart < 0) {
+        pathMeasure.getSegment(
+            length + newStart,
+            length,
+            extraTrimPath,
+            true);
       }
     }
Allow trim paths that have looped multiple times

#<I>