commit | 780a3f600f43671af1991d2ef2798288873570d8 | [log] [tgz] |
---|---|---|
author | Gabriel Peal <gabriel.peal@airbnb.com> | Sat Apr 08 12:59:10 2017 -0700 |
committer | Gabriel Peal <gabriel.peal@airbnb.com> | Sat Apr 08 12:59:10 2017 -0700 |
tree | 03932389a09c0efe737a7fa0f069ee8d488d1e68 | |
parent | c00b7ec4fe71a7258af9ae956a625a8f91c440f8 [diff] |
Fixed an issue with trim paths in which the start is just after the end
diff --git a/LottieSample/screenshots/LottieLogo2.png b/LottieSample/screenshots/LottieLogo2.png index 505a03c..18b321b 100644 --- a/LottieSample/screenshots/LottieLogo2.png +++ b/LottieSample/screenshots/LottieLogo2.png Binary files differ
diff --git a/LottieSample/screenshots/Tests_CheckSwitch.png b/LottieSample/screenshots/Tests_CheckSwitch.png index 43fd84e..f9bcb6c 100644 --- a/LottieSample/screenshots/Tests_CheckSwitch.png +++ b/LottieSample/screenshots/Tests_CheckSwitch.png Binary files differ
diff --git a/LottieSample/screenshots/lottiefiles.com_-_Progress_Success.png b/LottieSample/screenshots/lottiefiles.com_-_Progress_Success.png index acc0ee2..89a9d28 100644 --- a/LottieSample/screenshots/lottiefiles.com_-_Progress_Success.png +++ b/LottieSample/screenshots/lottiefiles.com_-_Progress_Success.png Binary files differ
diff --git a/LottieSample/screenshots/lottiefiles.com_-_Touch_ID.png b/LottieSample/screenshots/lottiefiles.com_-_Touch_ID.png index d2e5b45..d34bf4a 100644 --- a/LottieSample/screenshots/lottiefiles.com_-_Touch_ID.png +++ b/LottieSample/screenshots/lottiefiles.com_-_Touch_ID.png Binary files differ
diff --git a/lottie/src/main/java/com/airbnb/lottie/Utils.java b/lottie/src/main/java/com/airbnb/lottie/Utils.java index 5b5bd91..38f4838 100644 --- a/lottie/src/main/java/com/airbnb/lottie/Utils.java +++ b/lottie/src/main/java/com/airbnb/lottie/Utils.java
@@ -110,6 +110,11 @@ newEnd = MiscUtils.floorMod(newEnd, length); } + // If the start and end are length distance apart, just return the path; + if (Math.abs(Math.abs(newEnd - newStart) - length) < 1) { + return; + } + if (newStart < 0) { newStart = MiscUtils.floorMod(newStart, length); } @@ -117,6 +122,7 @@ newEnd = MiscUtils.floorMod(newEnd, length); } + // If the start and end are equals, return an empty path. if (newStart == newEnd) { path.reset(); return;