mirror of
https://github.com/dscyrescotti/Memola.git
synced 2026-07-10 14:52:46 +02:00
feat: add canvas lock button
This commit is contained in:
@@ -168,6 +168,12 @@ extension CanvasViewController {
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
canvas.$locksCanvas
|
||||
.sink { [weak self] state in
|
||||
self?.lockModeChanged(state)
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
tool.$selectedPen
|
||||
.sink { [weak self] pen in
|
||||
self?.penChanged(to: pen)
|
||||
@@ -308,6 +314,11 @@ extension CanvasViewController {
|
||||
func zoomChanged(_ zoomScale: CGFloat) {
|
||||
scrollView.setZoomScale(zoomScale, animated: true)
|
||||
}
|
||||
|
||||
func lockModeChanged(_ state: Bool) {
|
||||
scrollView.isScrollEnabled = !state
|
||||
scrollView.pinchGestureRecognizer?.isEnabled = !state
|
||||
}
|
||||
}
|
||||
|
||||
extension CanvasViewController {
|
||||
|
||||
Reference in New Issue
Block a user