Skip to content
This repository was archived by the owner on Mar 26, 2019. It is now read-only.

Commit 7011ced

Browse files
committed
修复删除全部内容时,不重置成绩的问题。
1 parent 6d1e751 commit 7011ced

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/me/ryan/controller/TextController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ private void updateText() {
158158
}
159159
}
160160

161+
// 用户在跟打过程中删除了已经输入的所有内容,这时要调用重打方法
162+
// 但是调用start前,要先恢复文章显示框的所有字符的样式,所以它要放这下面。
163+
if (inputLengthNow == 0 && inputLengthLast > 0) {
164+
this.start();
165+
}
161166

162167
// 跟打结束
163168
// TODO 结尾无错字才结束跟打

0 commit comments

Comments
 (0)