Remove MAX_SIZE restriction (#160)
Use large animations at your own risk.
Fixes #112
diff --git a/LottieSample/screenshots/HamburgerArrow 0.png b/LottieSample/screenshots/HamburgerArrow 0.png
index c1afe0f..db8d0bb 100644
--- a/LottieSample/screenshots/HamburgerArrow 0.png
+++ b/LottieSample/screenshots/HamburgerArrow 0.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 10.png b/LottieSample/screenshots/HamburgerArrow 10.png
index c1afe0f..db8d0bb 100644
--- a/LottieSample/screenshots/HamburgerArrow 10.png
+++ b/LottieSample/screenshots/HamburgerArrow 10.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 100.png b/LottieSample/screenshots/HamburgerArrow 100.png
index b4d7d6e..db8d0bb 100644
--- a/LottieSample/screenshots/HamburgerArrow 100.png
+++ b/LottieSample/screenshots/HamburgerArrow 100.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 20.png b/LottieSample/screenshots/HamburgerArrow 20.png
index 696105b..e2e9d24 100644
--- a/LottieSample/screenshots/HamburgerArrow 20.png
+++ b/LottieSample/screenshots/HamburgerArrow 20.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 30.png b/LottieSample/screenshots/HamburgerArrow 30.png
index a79d616..ade67c9 100644
--- a/LottieSample/screenshots/HamburgerArrow 30.png
+++ b/LottieSample/screenshots/HamburgerArrow 30.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 40.png b/LottieSample/screenshots/HamburgerArrow 40.png
index 89f0ab3..25f19ec 100644
--- a/LottieSample/screenshots/HamburgerArrow 40.png
+++ b/LottieSample/screenshots/HamburgerArrow 40.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 5.png b/LottieSample/screenshots/HamburgerArrow 5.png
index c1afe0f..db8d0bb 100644
--- a/LottieSample/screenshots/HamburgerArrow 5.png
+++ b/LottieSample/screenshots/HamburgerArrow 5.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 50.png b/LottieSample/screenshots/HamburgerArrow 50.png
index 89f0ab3..25f19ec 100644
--- a/LottieSample/screenshots/HamburgerArrow 50.png
+++ b/LottieSample/screenshots/HamburgerArrow 50.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 60.png b/LottieSample/screenshots/HamburgerArrow 60.png
index 89f0ab3..25f19ec 100644
--- a/LottieSample/screenshots/HamburgerArrow 60.png
+++ b/LottieSample/screenshots/HamburgerArrow 60.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 70.png b/LottieSample/screenshots/HamburgerArrow 70.png
index d435481..71eb826 100644
--- a/LottieSample/screenshots/HamburgerArrow 70.png
+++ b/LottieSample/screenshots/HamburgerArrow 70.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 80.png b/LottieSample/screenshots/HamburgerArrow 80.png
index b4d7d6e..db8d0bb 100644
--- a/LottieSample/screenshots/HamburgerArrow 80.png
+++ b/LottieSample/screenshots/HamburgerArrow 80.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 90.png b/LottieSample/screenshots/HamburgerArrow 90.png
index b4d7d6e..db8d0bb 100644
--- a/LottieSample/screenshots/HamburgerArrow 90.png
+++ b/LottieSample/screenshots/HamburgerArrow 90.png
Binary files differ
diff --git a/LottieSample/screenshots/HamburgerArrow 95.png b/LottieSample/screenshots/HamburgerArrow 95.png
index b4d7d6e..db8d0bb 100644
--- a/LottieSample/screenshots/HamburgerArrow 95.png
+++ b/LottieSample/screenshots/HamburgerArrow 95.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 0.png b/LottieSample/screenshots/LottieLogo1 0.png
index c748366..71ef839 100644
--- a/LottieSample/screenshots/LottieLogo1 0.png
+++ b/LottieSample/screenshots/LottieLogo1 0.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 10.png b/LottieSample/screenshots/LottieLogo1 10.png
index 3d93992..72b6cbd 100644
--- a/LottieSample/screenshots/LottieLogo1 10.png
+++ b/LottieSample/screenshots/LottieLogo1 10.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 100.png b/LottieSample/screenshots/LottieLogo1 100.png
index eb09660..e0d6967 100644
--- a/LottieSample/screenshots/LottieLogo1 100.png
+++ b/LottieSample/screenshots/LottieLogo1 100.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 20.png b/LottieSample/screenshots/LottieLogo1 20.png
index 24b8bfc..d63f4d6 100644
--- a/LottieSample/screenshots/LottieLogo1 20.png
+++ b/LottieSample/screenshots/LottieLogo1 20.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 30.png b/LottieSample/screenshots/LottieLogo1 30.png
index db97754..34b74a4 100644
--- a/LottieSample/screenshots/LottieLogo1 30.png
+++ b/LottieSample/screenshots/LottieLogo1 30.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 40.png b/LottieSample/screenshots/LottieLogo1 40.png
index 86f2e19..17220f4 100644
--- a/LottieSample/screenshots/LottieLogo1 40.png
+++ b/LottieSample/screenshots/LottieLogo1 40.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 5.png b/LottieSample/screenshots/LottieLogo1 5.png
index c748366..71ef839 100644
--- a/LottieSample/screenshots/LottieLogo1 5.png
+++ b/LottieSample/screenshots/LottieLogo1 5.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 50.png b/LottieSample/screenshots/LottieLogo1 50.png
index 94514f3..5f070d7 100644
--- a/LottieSample/screenshots/LottieLogo1 50.png
+++ b/LottieSample/screenshots/LottieLogo1 50.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 60.png b/LottieSample/screenshots/LottieLogo1 60.png
index 0c83bc2..2c51dc4 100644
--- a/LottieSample/screenshots/LottieLogo1 60.png
+++ b/LottieSample/screenshots/LottieLogo1 60.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 70.png b/LottieSample/screenshots/LottieLogo1 70.png
index e1d53d8..d29594a 100644
--- a/LottieSample/screenshots/LottieLogo1 70.png
+++ b/LottieSample/screenshots/LottieLogo1 70.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 80.png b/LottieSample/screenshots/LottieLogo1 80.png
index e1d53d8..d29594a 100644
--- a/LottieSample/screenshots/LottieLogo1 80.png
+++ b/LottieSample/screenshots/LottieLogo1 80.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 90.png b/LottieSample/screenshots/LottieLogo1 90.png
index eb09660..e0d6967 100644
--- a/LottieSample/screenshots/LottieLogo1 90.png
+++ b/LottieSample/screenshots/LottieLogo1 90.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo1 95.png b/LottieSample/screenshots/LottieLogo1 95.png
index eb09660..e0d6967 100644
--- a/LottieSample/screenshots/LottieLogo1 95.png
+++ b/LottieSample/screenshots/LottieLogo1 95.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 0.png b/LottieSample/screenshots/LottieLogo2 0.png
index f689c0a..cc73feb 100644
--- a/LottieSample/screenshots/LottieLogo2 0.png
+++ b/LottieSample/screenshots/LottieLogo2 0.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 10.png b/LottieSample/screenshots/LottieLogo2 10.png
index b971ca0..b0b45d6 100644
--- a/LottieSample/screenshots/LottieLogo2 10.png
+++ b/LottieSample/screenshots/LottieLogo2 10.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 100.png b/LottieSample/screenshots/LottieLogo2 100.png
index 5e674af..d74299a 100644
--- a/LottieSample/screenshots/LottieLogo2 100.png
+++ b/LottieSample/screenshots/LottieLogo2 100.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 20.png b/LottieSample/screenshots/LottieLogo2 20.png
index e220f9c..a1435ee 100644
--- a/LottieSample/screenshots/LottieLogo2 20.png
+++ b/LottieSample/screenshots/LottieLogo2 20.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 30.png b/LottieSample/screenshots/LottieLogo2 30.png
index 87f89d6..f964a37 100644
--- a/LottieSample/screenshots/LottieLogo2 30.png
+++ b/LottieSample/screenshots/LottieLogo2 30.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 40.png b/LottieSample/screenshots/LottieLogo2 40.png
index 4e3b471..01e0a5e 100644
--- a/LottieSample/screenshots/LottieLogo2 40.png
+++ b/LottieSample/screenshots/LottieLogo2 40.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 5.png b/LottieSample/screenshots/LottieLogo2 5.png
index 6ec85fb..b19a41b 100644
--- a/LottieSample/screenshots/LottieLogo2 5.png
+++ b/LottieSample/screenshots/LottieLogo2 5.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 50.png b/LottieSample/screenshots/LottieLogo2 50.png
index 472f2da..7dc9881 100644
--- a/LottieSample/screenshots/LottieLogo2 50.png
+++ b/LottieSample/screenshots/LottieLogo2 50.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 60.png b/LottieSample/screenshots/LottieLogo2 60.png
index e8baf06..a635ef2 100644
--- a/LottieSample/screenshots/LottieLogo2 60.png
+++ b/LottieSample/screenshots/LottieLogo2 60.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 70.png b/LottieSample/screenshots/LottieLogo2 70.png
index 5e674af..d74299a 100644
--- a/LottieSample/screenshots/LottieLogo2 70.png
+++ b/LottieSample/screenshots/LottieLogo2 70.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 80.png b/LottieSample/screenshots/LottieLogo2 80.png
index 5e674af..d74299a 100644
--- a/LottieSample/screenshots/LottieLogo2 80.png
+++ b/LottieSample/screenshots/LottieLogo2 80.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 90.png b/LottieSample/screenshots/LottieLogo2 90.png
index 5e674af..d74299a 100644
--- a/LottieSample/screenshots/LottieLogo2 90.png
+++ b/LottieSample/screenshots/LottieLogo2 90.png
Binary files differ
diff --git a/LottieSample/screenshots/LottieLogo2 95.png b/LottieSample/screenshots/LottieLogo2 95.png
index 5e674af..d74299a 100644
--- a/LottieSample/screenshots/LottieLogo2 95.png
+++ b/LottieSample/screenshots/LottieLogo2 95.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 0.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 0.png
index cbc9826..8f98b1d 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 0.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 0.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 10.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 10.png
index f1ca62b..eb545fa 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 10.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 10.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 100.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 100.png
index 9da6ef4..c5ed596 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 100.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 100.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 20.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 20.png
index fff912a..eb43a6b 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 20.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 20.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 30.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 30.png
index 9d7f0c4..6c5c9dc 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 30.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 30.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 40.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 40.png
index ada266e..bb10b50 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 40.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 40.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 5.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 5.png
index 6c08c94..872f3fa 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 5.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 5.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 50.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 50.png
index 9e627e2..4120dd1 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 50.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 50.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 60.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 60.png
index 8e31c35..a54c6fc 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 60.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 60.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 70.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 70.png
index 7d23450..9ad4efd 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 70.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 70.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 80.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 80.png
index 0aaa09b..727f181 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 80.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 80.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 90.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 90.png
index db4de52..37e490d 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 90.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 90.png
Binary files differ
diff --git a/LottieSample/screenshots/MotionCorpse-Jrcanest 95.png b/LottieSample/screenshots/MotionCorpse-Jrcanest 95.png
index 95381b7..17a40d5 100644
--- a/LottieSample/screenshots/MotionCorpse-Jrcanest 95.png
+++ b/LottieSample/screenshots/MotionCorpse-Jrcanest 95.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 0.png b/LottieSample/screenshots/Tests_Image 0.png
index c1c10d5..33a1c1e 100644
--- a/LottieSample/screenshots/Tests_Image 0.png
+++ b/LottieSample/screenshots/Tests_Image 0.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 10.png b/LottieSample/screenshots/Tests_Image 10.png
index 1b7f409..1db769c 100644
--- a/LottieSample/screenshots/Tests_Image 10.png
+++ b/LottieSample/screenshots/Tests_Image 10.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 100.png b/LottieSample/screenshots/Tests_Image 100.png
index 2f186e6..fd592ba 100644
--- a/LottieSample/screenshots/Tests_Image 100.png
+++ b/LottieSample/screenshots/Tests_Image 100.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 20.png b/LottieSample/screenshots/Tests_Image 20.png
index 89bf50a..a1938d2 100644
--- a/LottieSample/screenshots/Tests_Image 20.png
+++ b/LottieSample/screenshots/Tests_Image 20.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 30.png b/LottieSample/screenshots/Tests_Image 30.png
index 9c528f9..36cc8fe 100644
--- a/LottieSample/screenshots/Tests_Image 30.png
+++ b/LottieSample/screenshots/Tests_Image 30.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 40.png b/LottieSample/screenshots/Tests_Image 40.png
index 2ce3c91..421adbf 100644
--- a/LottieSample/screenshots/Tests_Image 40.png
+++ b/LottieSample/screenshots/Tests_Image 40.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 5.png b/LottieSample/screenshots/Tests_Image 5.png
index f4d8484..4814030 100644
--- a/LottieSample/screenshots/Tests_Image 5.png
+++ b/LottieSample/screenshots/Tests_Image 5.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 50.png b/LottieSample/screenshots/Tests_Image 50.png
index 398ae3f..17d1052 100644
--- a/LottieSample/screenshots/Tests_Image 50.png
+++ b/LottieSample/screenshots/Tests_Image 50.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 60.png b/LottieSample/screenshots/Tests_Image 60.png
index 4927cb2..bd1b5a7 100644
--- a/LottieSample/screenshots/Tests_Image 60.png
+++ b/LottieSample/screenshots/Tests_Image 60.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 70.png b/LottieSample/screenshots/Tests_Image 70.png
index 5e5d79b..ef1d383 100644
--- a/LottieSample/screenshots/Tests_Image 70.png
+++ b/LottieSample/screenshots/Tests_Image 70.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 80.png b/LottieSample/screenshots/Tests_Image 80.png
index eef4ca0..b2abb4d 100644
--- a/LottieSample/screenshots/Tests_Image 80.png
+++ b/LottieSample/screenshots/Tests_Image 80.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 90.png b/LottieSample/screenshots/Tests_Image 90.png
index 57eb324..e1f54f1 100644
--- a/LottieSample/screenshots/Tests_Image 90.png
+++ b/LottieSample/screenshots/Tests_Image 90.png
Binary files differ
diff --git a/LottieSample/screenshots/Tests_Image 95.png b/LottieSample/screenshots/Tests_Image 95.png
index 9116f37..9820581 100644
--- a/LottieSample/screenshots/Tests_Image 95.png
+++ b/LottieSample/screenshots/Tests_Image 95.png
Binary files differ
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java b/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
index 44f6755..449fbb9 100644
--- a/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
+++ b/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
@@ -4,7 +4,6 @@
import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.TypedArray;
-import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Looper;
@@ -154,19 +153,8 @@
}
@Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- }
-
- @Override
- protected void onDraw(Canvas canvas) {
- super.onDraw(canvas);
- }
-
- @Override
protected void onDetachedFromWindow() {
recycleBitmaps();
-
super.onDetachedFromWindow();
}
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieComposition.java b/lottie/src/main/java/com/airbnb/lottie/LottieComposition.java
index b8c5d25..540735a 100644
--- a/lottie/src/main/java/com/airbnb/lottie/LottieComposition.java
+++ b/lottie/src/main/java/com/airbnb/lottie/LottieComposition.java
@@ -27,14 +27,6 @@
* {@link com.airbnb.lottie.LottieDrawable}.
*/
public class LottieComposition {
- /**
- * The largest bitmap drawing cache can be is 8,294,400 bytes. There are 4 bytes per pixel
- * leaving ~2.3M pixels available.
- * Reduce the number a little bit for safety.
- * <p>
- * Hopefully this can be hardware accelerated someday.
- */
- private static final int MAX_PIXELS = 1000;
private final Map<String, List<Layer>> precomps = new HashMap<>();
private final Map<String, ImageAsset> images = new HashMap<>();
@@ -188,12 +180,6 @@
if (width != -1 && height != -1) {
int scaledWidth = (int) (width * scale);
int scaledHeight = (int) (height * scale);
- if (Math.max(scaledWidth, scaledHeight) > MAX_PIXELS) {
- float factor = (float) MAX_PIXELS / (float) Math.max(scaledWidth, scaledHeight);
- scaledWidth *= factor;
- scaledHeight *= factor;
- scale *= factor;
- }
bounds = new Rect(0, 0, scaledWidth, scaledHeight);
}
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
index ad84ad5..98915f0 100644
--- a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
+++ b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
@@ -206,9 +206,8 @@
float scaleY = bounds.height() / (float) compBounds.height();
canvas.scale(scaleX, scaleY);
}
- super.draw(canvas);
- // TODO: delete this?
canvas.clipRect(getBounds());
+ super.draw(canvas);
canvas.restoreToCount(saveCount);
}