mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
feat: 导入PPTX添加 fixedViewport 模式
This commit is contained in:
parent
a872f9f0ce
commit
58c1ca0600
@ -136,7 +136,13 @@ export default () => {
|
||||
}
|
||||
|
||||
// 导入PPTX文件
|
||||
const importPPTXFile = (files: FileList, cover = false) => {
|
||||
const importPPTXFile = (files: FileList, options?: { cover?: boolean; fixedViewport?: boolean }) => {
|
||||
const defaultOptions = {
|
||||
cover: false,
|
||||
fixedViewport: false,
|
||||
}
|
||||
const { cover, fixedViewport } = { ...defaultOptions, ...options }
|
||||
|
||||
const file = files[0]
|
||||
if (!file) return
|
||||
|
||||
@ -159,10 +165,12 @@ export default () => {
|
||||
return
|
||||
}
|
||||
|
||||
const ratio = 96 / 72
|
||||
let ratio = 96 / 72
|
||||
const width = json.size.width
|
||||
|
||||
if (fixedViewport) ratio = 1000 / width
|
||||
else slidesStore.setViewportSize(width * ratio)
|
||||
|
||||
slidesStore.setViewportSize(width * ratio)
|
||||
slidesStore.setTheme({ themeColors: json.themeColors })
|
||||
|
||||
const slides: Slide[] = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user