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

Commit

Permalink
fix: correct image key.
Browse files Browse the repository at this point in the history
  • Loading branch information
errnull committed Jun 17, 2019
1 parent c4d71e8 commit b8a85db
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,19 @@ class SVGAVideoEntity {
options.inPreferredConfig = Bitmap.Config.RGB_565
var filePath = cacheDir.absolutePath + "/" + imgObjects[imageKey]
var bitmap = if (File(filePath).exists()) BitmapFactory.decodeFile(filePath, options) else null
val bitmapKey = imageKey.replace(".matte", "")
if (bitmap != null) {
images.put(imageKey, bitmap)
images.put(bitmapKey, bitmap)
} else {
// bitmap.matte : bitmap
var filePath = cacheDir.absolutePath + "/" + imgObjects[imageKey] + ".png"
var bitmap = if (File(filePath).exists()) BitmapFactory.decodeFile(filePath, options) else null
if (bitmap != null) {
images.put(imageKey, bitmap)
images.put(bitmapKey, bitmap)
} else {
(cacheDir.absolutePath + "/" + imageKey + ".png").takeIf { File(it).exists() }?.let {
BitmapFactory.decodeFile(it, options)?.let {
images.put(imageKey, it)
images.put(bitmapKey, it)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ internal class SVGACanvasDrawer(videoItem: SVGAVideoEntity, val dynamicItem: SVG
val imageKey = sprite.imageKey ?: return
val isHidden = dynamicItem.dynamicHidden[imageKey] == true
if (isHidden) { return }
val drawingBitmap = (dynamicItem.dynamicImage[imageKey] ?: videoItem.images[imageKey]) ?: return
val bitmapKey = imageKey.replace(".matte", "")
val drawingBitmap = (dynamicItem.dynamicImage[bitmapKey] ?: videoItem.images[bitmapKey]) ?: return
val frameMatrix = shareFrameMatrix(sprite.frameEntity.transform)
val paint = this.sharedValues.sharedPaint()
paint.isAntiAlias = videoItem.antiAlias
Expand Down

0 comments on commit b8a85db

Please sign in to comment.