0
我创建SVG,我想转换svg到画布。 我做到以下几点:帆布Path2d内阴影
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var p = new Path2D("M10 10 h 80 v 80 h -80 Z");
ctx.fillStyle = '#cb1a2f';
ctx.shadowColor = "rgba(0, 0, 0, 0.5)";
ctx.shadowBlur = 24;
ctx.fill(p);
但我想使正方形内阴影。我有一个完全不同的图SVG。这个SVG纯粹就是一个例子。
@Kaiido它只是移动的影子,我需要把它里面的造型 – annex