Handle pinch action

This commit is contained in:
Tusooa Zhu 2021-08-01 21:39:07 -04:00
parent a7570f5eb2
commit d9030b4fdd
No known key found for this signature in database
GPG key ID: 7B467EDE43A08224
4 changed files with 57 additions and 16 deletions

View file

@ -62,16 +62,12 @@ const mediaViewer = {
applyScaling (state, { scaling }) {
state.scaling = state.origScaling * scaling
},
finishOffsets (state) {
finish (state) {
state.origOffsets = [...state.offsets]
},
finishScaling (state) {
state.origScaling = state.scaling
},
revertOffsets (state) {
revert (state) {
state.offsets = [...state.origOffsets]
},
revertScaling (state) {
state.scaling = state.origScaling
}
},
@ -85,12 +81,10 @@ const mediaViewer = {
commit('applyScaling', { scaling })
},
finish ({ commit }) {
commit('finishOffsets')
commit('finishScaling')
commit('finish')
},
revert ({ commit }) {
commit('revertOffsets')
commit('revertScaling')
commit('revert')
}
}
}