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

Commit

Permalink
fix: matte 区域错误
Browse files Browse the repository at this point in the history
  • Loading branch information
caiyuwei committed Oct 8, 2020
1 parent e53b0e3 commit e9b81b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,22 @@ public void onError() {

private String randomSample() {
if (samples.size() == 0) {
samples.add("gradientBorder.svga");
samples.add("Goddess.svga");
samples.add("Rocket.svga");
samples.add("angel.svga");
samples.add("750x80.svga");
samples.add("alarm.svga");
samples.add("angel.svga");
samples.add("Castle.svga");
samples.add("EmptyState.svga");
samples.add("Goddess.svga");
samples.add("gradientBorder.svga");
samples.add("heartbeat.svga");
samples.add("matteBitmap.svga");
samples.add("matteBitmap_1.x.svga");
samples.add("matteRect.svga");
samples.add("MerryChristmas.svga");
samples.add("posche.svga");
samples.add("Rocket.svga");
samples.add("rose.svga");
samples.add("rose_2.0.0.svga");
samples.add("Castle.svga");
samples.add("MerryChristmas.svga");
}
return samples.get((int) Math.floor(Math.random() * samples.size()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,14 @@ internal class SVGACanvasDrawer(videoItem: SVGAVideoEntity, val dynamicItem: SVG
maskPath.buildPath(path)
path.transform(frameMatrix)
canvas.clipPath(path)
frameMatrix.preScale((sprite.frameEntity.layout.width / drawingBitmap.width).toFloat(), (sprite.frameEntity.layout.width / drawingBitmap.width).toFloat())
frameMatrix.preScale((sprite.frameEntity.layout.width / drawingBitmap.width).toFloat(), (sprite.frameEntity.layout.height / drawingBitmap.height).toFloat())
if (!drawingBitmap.isRecycled) {
canvas.drawBitmap(drawingBitmap, frameMatrix, paint)
}
canvas.restore()
}
else {
frameMatrix.preScale((sprite.frameEntity.layout.width / drawingBitmap.width).toFloat(), (sprite.frameEntity.layout.width / drawingBitmap.width).toFloat())
frameMatrix.preScale((sprite.frameEntity.layout.width / drawingBitmap.width).toFloat(), (sprite.frameEntity.layout.height / drawingBitmap.height).toFloat())
if (!drawingBitmap.isRecycled) {
canvas.drawBitmap(drawingBitmap, frameMatrix, paint)
}
Expand Down

0 comments on commit e9b81b4

Please sign in to comment.