Skip to content

Commit

Permalink
fix: Non-number slideScale causing mispositioning (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
dizys committed May 25, 2021
1 parent 53ec985 commit 596b4a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/client/internals/Settings.vue
Expand Up @@ -3,10 +3,10 @@ import { slideScale } from '../state'
import SelectList from './SelectList.vue'
import type { SelectionItem } from './types'
const items: SelectionItem<number | null>[] = [
const items: SelectionItem<number>[] = [
{
display: 'Fit',
value: null,
value: 0,
},
{
display: '1:1',
Expand Down
2 changes: 1 addition & 1 deletion packages/client/internals/SlideContainer.vue
Expand Up @@ -33,7 +33,7 @@ if (props.width) {
const screenAspect = computed(() => width.value / height.value)
const scale = computed(() => {
if (props.scale != null)
if (props.scale)
return props.scale
if (screenAspect.value < slideAspect)
return width.value / slideWidth
Expand Down
2 changes: 1 addition & 1 deletion packages/client/state/index.ts
Expand Up @@ -20,7 +20,7 @@ export const isOnFocus = computed(() => ['BUTTON', 'A'].includes(activeElement.v

export const currentCamera = useStorage<string>('slidev-camera', 'default')
export const currentMic = useStorage<string>('slidev-mic', 'default')
export const slideScale = useStorage<number>('slidev-scale', null)
export const slideScale = useStorage<number>('slidev-scale', 0)

export const showEditor = useStorage('slidev-show-editor', false)
export const editorWidth = useStorage('slidev-editor-width', isClient ? window.innerWidth * 0.4 : 100)
Expand Down

0 comments on commit 596b4a7

Please sign in to comment.