Javascript 旋转后HTML画布阴影模糊不工作

Javascript 旋转后HTML画布阴影模糊不工作,javascript,html,canvas,Javascript,Html,Canvas,我遇到的问题是,如果我旋转画布来绘制图像,画布在绘制图像时将不会绘制阴影模糊效果。如果我将“旋转”值设置为0度,效果会非常好 我很快就创建了一个JSFIDLE,图像是像素化和扭曲的,但无论如何,它再现了这个问题 编辑:似乎是Chrome唯一的问题 这是密码 var canvas = document.getElementById('GameCanvas'); var ctx = canvas.getContext("2d"); var asset = card.asset; // set t

我遇到的问题是,如果我旋转画布来绘制图像,画布在绘制图像时将不会绘制阴影模糊效果。如果我将“旋转”值设置为0度,效果会非常好

我很快就创建了一个JSFIDLE,图像是像素化和扭曲的,但无论如何,它再现了这个问题

编辑:似乎是Chrome唯一的问题

这是密码

var canvas = document.getElementById('GameCanvas');
var ctx = canvas.getContext("2d");

var asset = card.asset;

// set the card height based off the width
var height = width * 2.66;

// save the canvas before rotating
ctx.save();

// hover effect for drawn card
if (core.information.xoffset >= left && core.information.xoffset <= left + width && core.information.yoffset >= top && core.information.yoffset <= top + height) {

    ctx.shadowColor = 'white';
    ctx.shadowBlur = 15;

}

// translate to the center of the card
ctx.translate(core.information.pwidth * (left + width/2), core.information.pheight * (top + height/2));

// rotate the canvas for the card
ctx.rotate(rotation * Math.PI/180);

// translate back
ctx.translate(-core.information.pwidth * (left + width/2), -core.information.pheight * (top + height/2));

// draw the card
ctx.drawImage(asset, core.information.pwidth * left, core.information.pheight * top, core.information.pwidth * width, core.information.pheight * height);

// restore the canvas after rotating    
ctx.restore();
var canvas=document.getElementById('GameCanvas');
var ctx=canvas.getContext(“2d”);
var资产=card.asset;
//根据宽度设置卡片高度
可变高度=宽度*2.66;
//旋转前保存画布
ctx.save();
//抽牌悬停效果
如果(core.information.xoffset>=left&&core.information.xoffset=top&&core.information.yoffset有相同的问题


首先将模糊图像绘制到临时画布上,然后将其作为图像(旋转)绘制到“最终”画布上画布。

你能提供一个片段/提琴吗?请提供一个提琴。你可以用它来做。图像是像素化和扭曲的,但它与我的问题是一样的,如果旋转值没有设置为0,它就不会有无法复制的阴影效果-我在所有角度都得到阴影(我夸大了颜色和模糊):真的吗?在我的屏幕上,如果旋转的值不是0,阴影就会消失。这可能是浏览器的问题吗?编辑:只是在Edge中尝试过,似乎这个问题只存在于Chrome中。有没有修复建议?