mirror of
https://github.com/dscyrescotti/Memola.git
synced 2026-05-17 13:17:03 +02:00
refactor: clean up
This commit is contained in:
@@ -324,7 +324,8 @@ extension GraphicContext {
|
|||||||
let bounds = [origin.x - size.width / 2, origin.y - size.height / 2, origin.x + size.width / 2, origin.y + size.height / 2]
|
let bounds = [origin.x - size.width / 2, origin.y - size.height / 2, origin.x + size.width / 2, origin.y + size.height / 2]
|
||||||
let photo = Photo(url: photoItem.id, size: size, origin: origin, bounds: bounds, createdAt: .now, bookmark: photoItem.bookmark)
|
let photo = Photo(url: photoItem.id, size: size, origin: origin, bounds: bounds, createdAt: .now, bookmark: photoItem.bookmark)
|
||||||
tree.insert(photo.element, in: photo.photoBox)
|
tree.insert(photo.element, in: photo.photoBox)
|
||||||
withPersistence(\.backgroundContext) { [_photo = photo, graphicContext = object] context in
|
withPersistence(\.backgroundContext) { [weak _photo = photo, weak graphicContext = object] context in
|
||||||
|
guard let _photo else { return }
|
||||||
let photo = PhotoObject(\.backgroundContext)
|
let photo = PhotoObject(\.backgroundContext)
|
||||||
photo.imageURL = _photo.url
|
photo.imageURL = _photo.url
|
||||||
photo.bounds = _photo.bounds
|
photo.bounds = _photo.bounds
|
||||||
|
|||||||
Reference in New Issue
Block a user