Skip to content

Commit

Permalink
fix: limit viewport size to avoid going minus value (fix #28)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsn committed Apr 23, 2018
1 parent 9f6be7d commit dc43f42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/view/store/modules/viewport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ export const viewport: DefineModule<

mutations: {
resize(state, { width, height }) {
state.width = Math.floor(width)
state.height = Math.floor(height)
const min = 10
state.width = Math.max(min, Math.floor(width))
state.height = Math.max(min, Math.floor(height))
},

zoom(state, scale) {
Expand Down

0 comments on commit dc43f42

Please sign in to comment.