refactor: clean up

This commit is contained in:
dscyrescotti
2024-06-11 00:19:11 +07:00
parent 164fd457a3
commit e775d9e016

View File

@@ -48,7 +48,7 @@ final class GraphicContext: @unchecked Sendable {
switch stroke.style {
case .marker:
guard let penStroke = stroke.stroke(as: PenStroke.self) else { return }
let deletedStroke = tree.remove(penStroke.anyStroke, in: penStroke.strokeBox)
tree.remove(penStroke.anyStroke, in: penStroke.strokeBox)
withPersistence(\.backgroundContext) { [weak penStroke] context in
penStroke?.object?.graphicContext = nil
try context.saveIfNeeded()