Skip to content

Commit

Permalink
fix keyboard zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
farin committed May 21, 2021
1 parent 57c288b commit e8e7d75
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/renderer/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import JoinGameDialog from '@/components/JoinGameDialog'
import SettingsDialog from '@/components/SettingsDialog'
import { getAppVersion } from '@/utils/version'
const ZOOM_SENSITIVITY = 1.4
export default {
components: {
AboutDialog,
Expand Down Expand Up @@ -145,10 +147,10 @@ export default {
this.$store.dispatch('game/undo')
})
ipcRenderer.on('menu.zoom-in', () => {
this.$root.$emit('request-zoom', 1.4)
this.$root.$emit('request-zoom', ZOOM_SENSITIVITY)
})
ipcRenderer.on('menu.zoom-out', () => {
this.$root.$emit('request-zoom', -1.4)
this.$root.$emit('request-zoom', -ZOOM_SENSITIVITY)
})
ipcRenderer.on('menu.game-tiles', () => {
this.$store.commit('showGameTiles', !this.$store.state.showGameTiles)
Expand Down Expand Up @@ -266,11 +268,11 @@ export default {
onKeyDown (ev) {
if (ev.key === '+') { // bind both + and numpad +
this.zoomIn()
this.$root.$emit('request-zoom', ZOOM_SENSITIVITY)
return
}
if (ev.key === '-') {
this.zoomOut()
this.$root.$emit('request-zoom', -ZOOM_SENSITIVITY)
return
}
if (ev.key === 'Escape' && this.showAbout) {
Expand Down

0 comments on commit e8e7d75

Please sign in to comment.