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

Commit f9e3827

Browse files
committed
fix: Remove clipPath support.
1 parent a0c5a79 commit f9e3827

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

app/src/main/assets/matte.svga

561 Bytes
Binary file not shown.

app/src/main/java/com/example/ponycui_home/svgaplayer/AnimationFromAssetsActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void onClick(View view) {
3737

3838
private void loadAnimation() {
3939
SVGAParser parser = new SVGAParser(this);
40-
parser.decodeFromAssets(this.randomSample(), new SVGAParser.ParseCompletion() {
40+
parser.decodeFromAssets("matte.svga", new SVGAParser.ParseCompletion() {
4141
@Override
4242
public void onComplete(@NotNull SVGAVideoEntity videoItem) {
4343
animationView.setVideoItem(videoItem);

library/src/main/java/com/opensource/svgaplayer/drawer/SVGACanvasDrawer.kt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ internal class SVGACanvasDrawer(videoItem: SVGAVideoEntity, val dynamicItem: SVG
173173
paint.style = Paint.Style.FILL
174174
paint.color = it
175175
paint.alpha = Math.min(255, Math.max(0, (sprite.frameEntity.alpha * 255).toInt()))
176-
if (sprite.frameEntity.maskPath !== null) canvas.save()
177-
sprite.frameEntity.maskPath?.let { maskPath ->
178-
val path2 = this.sharedValues.sharedPath2()
179-
maskPath.buildPath(path2)
180-
path2.transform(frameMatrix)
181-
canvas.clipPath(path2)
182-
}
176+
// if (sprite.frameEntity.maskPath !== null) canvas.save()
177+
// sprite.frameEntity.maskPath?.let { maskPath ->
178+
// val path2 = this.sharedValues.sharedPath2()
179+
// maskPath.buildPath(path2)
180+
// path2.transform(frameMatrix)
181+
// canvas.clipPath(path2)
182+
// }
183+
// if (sprite.frameEntity.maskPath !== null) canvas.restore()
183184
canvas.drawPath(path, paint)
184-
if (sprite.frameEntity.maskPath !== null) canvas.restore()
185185
}
186186
}
187187
shape.styles?.strokeWidth?.let {
@@ -220,15 +220,15 @@ internal class SVGACanvasDrawer(videoItem: SVGAVideoEntity, val dynamicItem: SVG
220220
), it[2] * scale)
221221
}
222222
}
223-
if (sprite.frameEntity.maskPath !== null) canvas.save()
224-
sprite.frameEntity.maskPath?.let { maskPath ->
225-
val path2 = this.sharedValues.sharedPath2()
226-
maskPath.buildPath(path2)
227-
path2.transform(frameMatrix)
228-
canvas.clipPath(path2)
229-
}
223+
// if (sprite.frameEntity.maskPath !== null) canvas.save()
224+
// sprite.frameEntity.maskPath?.let { maskPath ->
225+
// val path2 = this.sharedValues.sharedPath2()
226+
// maskPath.buildPath(path2)
227+
// path2.transform(frameMatrix)
228+
// canvas.clipPath(path2)
229+
// }
230+
// if (sprite.frameEntity.maskPath !== null) canvas.restore()
230231
canvas.drawPath(path, paint)
231-
if (sprite.frameEntity.maskPath !== null) canvas.restore()
232232
}
233233
}
234234
}

0 commit comments

Comments
 (0)