canvas安卓阴影显示问题
-代码 var me = this; var CanvasContext = wx.createCanvasContext('myCanvas', this); var windowWidth = me.data.windowWidth; var windowHeight = me.data.windowHeight; var bili = 1; var centerX = windowWidth / 2; var gao = (windowHeight * 0.65) * (1 / 3); var centerY = (windowHeight * 0.65) * (1 / 3); bili = imageWidth / imageHeight; var kuan = bili * gao; CanvasContext.setShadow(10, 15, 1, '#000000'); // CanvasContext.shadowOffsetX = 10; // CanvasContext.shadowOffsetY = 15; // CanvasContext.shadowColor = '#000000'; // CanvasContext.shadowBlur = 1; CanvasContext.drawImage(lingbuPath, 0, 0, kuan + 40, gao + 80, centerX - 20, centerY - 40, kuan + 40, gao + 80); CanvasContext.setShadow(0, 0, 0, 'black'); CanvasContext.drawImage(jutiaoPath, 0, 0, kuan + 5, gao + 5, centerX - 2.5, centerY - 2.5, kuan + 5, gao + 5); CanvasContext.drawImage(imagePath, 0, 0, imageWidth, imageHeight, centerX, centerY, kuan, gao); CanvasContext.draw(); 开发工具和ios显示正常,安卓显示如下图 - 当前 Bug 的表现 [图片] 直接绘制一个矩形,则安卓阴影显示正常 [图片] - 预期表现 [图片]