Skip to content

Commit

Permalink
Merge pull request #18 from ruckustboom/undo-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
olup authored Jun 26, 2023
2 parents f4fa254 + 5f4e767 commit 161f888
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/src/main/java/com/olup/notable/classes/DrawCanvas.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ class DrawCanvas(
getActualState().pen,
plist.points
)
coroutineScope.launch {
commitHistorySignal.emit(Unit)
}
}

if (getActualState().mode == Mode.Select) {
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/com/olup/notable/utils/history.kt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class History(coroutineScope: CoroutineScope, pageView: PageView) {

fun addOperationsToHistory(operations: OperationBlock) {
undoList.add(operations)
if(undoList.size > 5) undoList.removeFirst()
redoList.clear()
}
}

0 comments on commit 161f888

Please sign in to comment.