Open 520ph opened 5 years ago
某些版本下小程序canvas本身的bug,我现在没有机器测试。
https://github.com/spritejs/sprite-core/blob/master/src/helpers/render.js
这里的 drawRadiusBox
export function drawRadiusBox(context, {x, y, w, h, r}) {
context.beginPath();
context.moveTo(x + r, y);
context.arcTo(x + w, y, x + w, y + h, r);
context.arcTo(x + w, y + h, x, y + h, r);
context.arcTo(x, y + h, x, y, r);
context.arcTo(x, y, x + w, y, r);
context.closePath();
}
可能最终显示出来的有问题
我使用网络图片,本地图片。或者 bgcolor 属性设置 Sprite。加上 borderRadius 就会裁剪错。在模拟器上没问题,暂时只在小米5s上遇到了。
测试代码