Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
fix: Ignore matte layer when Build.VERSION.SDK_INT unsupport.
Browse files Browse the repository at this point in the history
  • Loading branch information
errnull committed Oct 30, 2019
1 parent fedf034 commit 0db05f2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ internal class SVGACanvasDrawer(videoItem: SVGAVideoEntity, val dynamicItem: SVG
private var beginIndexList: Array<Boolean>? = null
private var endIndexList: Array<Boolean>? = null

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
override fun drawFrame(canvas: Canvas, frameIndex: Int, scaleType: ImageView.ScaleType) {
super.drawFrame(canvas,frameIndex, scaleType)
this.pathCache.onSizeChanged(canvas)
Expand Down Expand Up @@ -61,9 +60,10 @@ internal class SVGACanvasDrawer(videoItem: SVGAVideoEntity, val dynamicItem: SVG
}
/// Is matte begin
if (isMatteBegin(index, sprites)) {
saveID = canvas.saveLayer(0f, 0f, canvas.width.toFloat(), canvas.height.toFloat(), null)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
saveID = canvas.saveLayer(0f, 0f, canvas.width.toFloat(), canvas.height.toFloat(), null)
}
}

/// Normal matte
drawSprite(svgaDrawerSprite, canvas, frameIndex)

Expand Down

0 comments on commit 0db05f2

Please sign in to comment.