【发布时间】:2019-04-15 08:47:15
【问题描述】:
当我为背景设置任何颜色时,动画效果很好。但是当我放置透明背景时,动画“波浪”开始留下痕迹。我该如何解决这个问题?
https://codepen.io/obiwan-kenobi/pen/JebWjG
ctx.fillStyle = 'rgba(255,255,255,0)';
ctx.fillRect.apply(ctx, _toConsumableArray(bounds.params));
【问题讨论】:
-
在第 338 行使用
clearRect而不是fillRect。而且你不需要设置ctx.fillStyle = "rgba(255,255,255,0)"; -
@enxaneta,谢谢!是的!这正是我所需要的。
标签: javascript canvas