feature: 图片保存裁剪区域比例

This commit is contained in:
CPPAlien 2019-11-22 14:05:33 +08:00
parent 7f05fddb3d
commit 4005dd840e

View File

@ -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);