Skip to content

Commit f3d76a4

Browse files
authored
Merge pull request hey-lee#1 from coder-layne/globalAlpha
globalAlpha of canvas context
2 parents 85b0b5c + 8b7a503 commit f3d76a4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class blurify {
3737

3838
blurify(canvas, blur) {
3939
let ctx = canvas.getContext('2d');
40-
ctx.globalAlpha = 0.5;
40+
ctx.globalAlpha = 1 / (2 * blur);
4141
for (let y = -blur; y <= blur; y += 2) {
4242
for (let x = -blur; x <= blur; x += 2) {
4343
ctx.drawImage(canvas, x, y);

0 commit comments

Comments
 (0)