fix blending context
This commit is contained in:
parent
ebb7bc537f
commit
5473d0c46a
1 changed files with 3 additions and 2 deletions
|
@ -92,7 +92,8 @@ export default class Collage extends Vue {
|
|||
}
|
||||
|
||||
private mounted() {
|
||||
this.reset();
|
||||
const canvas = (this.$refs.canvas as HTMLCanvasElement);
|
||||
this.context = canvas.getContext("2d") as CanvasRenderingContext2D;
|
||||
}
|
||||
|
||||
@Watch("images")
|
||||
|
@ -114,8 +115,8 @@ export default class Collage extends Vue {
|
|||
}
|
||||
|
||||
private reset() {
|
||||
this.context.globalCompositeOperation = "source-over";
|
||||
const canvas = (this.$refs.canvas as HTMLCanvasElement);
|
||||
this.context = canvas.getContext("2d") as CanvasRenderingContext2D;
|
||||
this.context.clearRect(0, 0, canvas.width, canvas.height);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue