From 723162443fde150ba43e47651d77922dae713350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chester=20Fu=20=28=E4=BB=98=E6=B3=93=E7=A8=8B=29?= Date: Mon, 13 May 2019 09:56:58 +0800 Subject: [PATCH] =?UTF-8?q?[Mod]=20=E7=BB=98=E5=88=B6=E6=96=87=E5=AD=97?= =?UTF-8?q?=E6=97=B6=E6=9C=89bg=E5=92=8CborderRadius=E6=97=B6=E5=9C=86?= =?UTF-8?q?=E8=A7=92=E5=9C=A8bg=E4=B8=8A=E5=B9=B6=E4=B8=94=E6=96=87?= =?UTF-8?q?=E5=AD=97=E4=B8=8D=E5=9C=86=E8=A7=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pen.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/pen.js b/lib/pen.js index 0928d03..3c44f30 100644 --- a/lib/pen.js +++ b/lib/pen.js @@ -250,13 +250,14 @@ export default class Painter { } const width = rawWidth + pd[1] + pd[3]; const height = rawHeight + pd[0] + pd[2]; + this._doClip(view.css.borderRadius, width, height) if (GD.api.isGradient(background)) { GD.api.doGradient(background, width, height, this.ctx); } else { this.ctx.setFillStyle(background); } this.ctx.fillRect(-(width / 2), -(height / 2), width, height); - + this.ctx.restore(); } @@ -318,7 +319,7 @@ export default class Painter { width, height, extra, - } = this._preProcess(view); + } = this._preProcess(view, view.css.background && view.css.borderRadius); this.ctx.setFillStyle(view.css.color || 'black'); const {