Merge pull request #119 from hongchengfhc/master

[Mod] 绘制文字时有bg和borderRadius时圆角在bg上并且文字不圆角
This commit is contained in:
Chris 2019-10-17 18:24:34 +08:00 committed by GitHub
commit 22ec4b5c9a

View File

@ -308,6 +308,7 @@ export default class Painter {
} }
const width = rawWidth + pd[1] + pd[3]; const width = rawWidth + pd[1] + pd[3];
const height = rawHeight + pd[0] + pd[2]; const height = rawHeight + pd[0] + pd[2];
this._doClip(view.css.borderRadius, width, height)
if (GD.api.isGradient(background)) { if (GD.api.isGradient(background)) {
GD.api.doGradient(background, width, height, this.ctx); GD.api.doGradient(background, width, height, this.ctx);
} else { } else {
@ -376,7 +377,7 @@ export default class Painter {
width, width,
height, height,
extra, extra,
} = this._preProcess(view); } = this._preProcess(view, view.css.background && view.css.borderRadius);
this.ctx.setFillStyle(view.css.color || 'black'); this.ctx.setFillStyle(view.css.color || 'black');
const { const {