From b25fafb256c308964b4278ea154665284fe592ae Mon Sep 17 00:00:00 2001 From: errnull Date: Wed, 19 Jun 2019 16:32:45 +0800 Subject: [PATCH] fix: update filter when matte sprite frame alpha = 0, it is visuable. --- .../java/com/opensource/svgaplayer/drawer/SGVADrawer.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/com/opensource/svgaplayer/drawer/SGVADrawer.kt b/library/src/main/java/com/opensource/svgaplayer/drawer/SGVADrawer.kt index b9dd17a0..8b7320a1 100644 --- a/library/src/main/java/com/opensource/svgaplayer/drawer/SGVADrawer.kt +++ b/library/src/main/java/com/opensource/svgaplayer/drawer/SGVADrawer.kt @@ -19,10 +19,12 @@ open internal class SGVADrawer(val videoItem: SVGAVideoEntity) { internal fun requestFrameSprites(frameIndex: Int): List { return videoItem.sprites.mapNotNull { if (frameIndex >= 0 && frameIndex < it.frames.size) { - if (it.frames[frameIndex].alpha <= 0.0) { - return@mapNotNull null + it.imageKey?.let { imageKey -> + if (!imageKey.endsWith(".matte") && it.frames[frameIndex].alpha <= 0.0) { + return@mapNotNull null + } + return@mapNotNull SVGADrawerSprite(it.matteKey, it.imageKey, it.frames[frameIndex]) } - return@mapNotNull SVGADrawerSprite(it.matteKey, it.imageKey, it.frames[frameIndex]) } return@mapNotNull null }