Skip to content

Commit 27bee04

Browse files
author
likai
committed
fix: 马赛克第一次绘制时无法还原画布状态问题
1 parent 8797cee commit 27bee04

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,10 @@ export default class ScreenShot {
754754
case "mosaicPen":
755755
// 当前为马赛克工具则修改绘制状态
756756
// 前面做了判断,此处需要特殊处理
757-
this.drawStatus = true;
757+
if (!this.drawStatus) {
758+
this.showLastHistory();
759+
this.drawStatus = true;
760+
}
758761
// 绘制马赛克,为了确保鼠标位置在绘制区域中间,所以对x、y坐标进行-10处理
759762
drawMosaic(
760763
currentX - 10,
@@ -1130,11 +1133,9 @@ export default class ScreenShot {
11301133
if (this.screenShotContainer == null || this.screenShotCanvas == null) {
11311134
return;
11321135
}
1133-
console.log(this.drawStatus);
11341136
// 工具栏已点击且进行了绘制
11351137
if (this.data.getToolClickStatus() && this.drawStatus) {
11361138
// 保存绘制记录
1137-
console.log("保存绘制记录");
11381139
addHistory();
11391140
return;
11401141
} else if (this.data.getToolClickStatus() && !this.drawStatus) {

0 commit comments

Comments
 (0)