fix: 修复渐变效果时圆角无效问题
This commit is contained in:
parent
7e6ebf4878
commit
91fa810503
@ -39,8 +39,8 @@
|
||||
for (let i = 0; i < colorPer.colors.length; i++) {
|
||||
grd.addColorStop(colorPer.percents[i], colorPer.colors[i]);
|
||||
}
|
||||
ctx.setFillStyle(grd);
|
||||
ctx.fillRect(-(width / 2), -(height / 2), width, height);
|
||||
ctx.fillStyle = grd;
|
||||
//ctx.fillRect(-(width / 2), -(height / 2), width, height);
|
||||
}
|
||||
|
||||
function analizeLinear(bg, width, height) {
|
||||
@ -93,8 +93,8 @@
|
||||
for (let i = 0; i < colorPer.colors.length; i++) {
|
||||
grd.addColorStop(colorPer.percents[i], colorPer.colors[i]);
|
||||
}
|
||||
ctx.setFillStyle(grd);
|
||||
ctx.fillRect(-(width / 2), -(height / 2), width, height);
|
||||
ctx.fillStyle = grd
|
||||
//ctx.fillRect(-(width / 2), -(height / 2), width, height);
|
||||
}
|
||||
|
||||
module.exports = { api }
|
||||
|
||||
@ -43,6 +43,7 @@ export default class Painter {
|
||||
this.ctx.fillRect(-(width / 2), -(height / 2), width, height);
|
||||
} else if (GD.api.isGradient(bg)) {
|
||||
GD.api.doGradient(bg, width, height, this.ctx);
|
||||
this.ctx.fillRect(-(width / 2), -(height / 2), width, height);
|
||||
} else {
|
||||
// 背景填充图片
|
||||
this.ctx.drawImage(bg, -(width / 2), -(height / 2), width, height);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user