From 4005dd840e7f1dd19e06f04e3f3d6d2ce497b431 Mon Sep 17 00:00:00 2001 From: CPPAlien Date: Fri, 22 Nov 2019 14:05:33 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E5=9B=BE=E7=89=87=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E8=A3=81=E5=89=AA=E5=8C=BA=E5=9F=9F=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pen.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pen.js b/lib/pen.js index 10ec8b1..359550a 100644 --- a/lib/pen.js +++ b/lib/pen.js @@ -464,6 +464,10 @@ export default class Painter { this.ctx.drawImage(view.url, -(width / 2), -(height / 2), width, height); } else { this.ctx.drawImage(view.url, startX, startY, rWidth, rHeight, -(width / 2), -(height / 2), width, height); + view.rect.startX = startX / view.sWidth; + view.rect.startY = startY / view.sHeight; + view.rect.endX = (startX + rWidth) / view.sWidth; + view.rect.endY = (startY + rHeight) / view.sHeight; } this.ctx.restore(); this._doBorder(view, width, height);