Skip to content

Commit

Permalink
fix: normalize scale delta during various environment (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsn committed May 27, 2018
1 parent 720a51d commit 2aab18c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/view/components/Viewport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import Vue from 'vue'
import GlobalEvents from 'vue-global-events'
import Resizable from './Resizable.vue'
import { minmax } from '@/utils'
export default Vue.extend({
name: 'Viewport',
Expand Down Expand Up @@ -55,7 +56,8 @@ export default Vue.extend({
methods: {
onZoom(event: WheelEvent): void {
this.$emit('zoom', this.scale - event.deltaY * 0.01)
const normalized = minmax(-0.1, event.deltaY * 0.01, 0.1)
this.$emit('zoom', this.scale - normalized)
}
}
})
Expand Down

0 comments on commit 2aab18c

Please sign in to comment.