Created
September 11, 2018 20:42
-
-
Save Jorger/1b60d19f92cae9dc38cf9d267ab946fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Se carga la imagen en el canvas copia... | |
ctxCopy.clearRect(0, 0, 100, 100); | |
ctxCopy.drawImage(figures[dataPipe[2] - 1].i, 0, 0, width, width); | |
//Se aplica el color si es necesario... | |
if (dataPipe[4] !== "") { | |
ctxCopy.globalCompositeOperation = "source-atop"; | |
//Color a aplicar... | |
ctxCopy.fillStyle = dataPipe[4]; | |
ctxCopy.fillRect(0, 0, width, width); | |
} | |
//Se carga la imagen después de la transformación | |
ctx.drawImage(canvasCopy, 0, 0); | |
//Se reestablece la propiedad por defecto... | |
ctxCopy.globalCompositeOperation = "source-over"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment