This commit is contained in:
Kyle
2018-10-28 19:10:23 -07:00
parent f9b854c728
commit c3941d5aa7
48 changed files with 210 additions and 122 deletions

View File

@@ -1,7 +1,8 @@
var mask = document.createElement("canvas")
var maskContext = mask.getContext("2d")
function drawMask(img, x, y, width, height, imgMask, secondMask, arg) {
function drawMask(img, x, y, width, height, targetContext, imgMask, secondMask, arg) {
var context = targetContext
mask.width = width
mask.height = height
maskContext.clearRect(0, 0, width, height)
@@ -22,5 +23,5 @@ function drawMask(img, x, y, width, height, imgMask, secondMask, arg) {
} else {
maskContext.drawImage(img, 0, 0, width, height)
}
card.drawImage(mask, x, y, width, height)
targetContext.drawImage(mask, x, y, width, height)
}