|
|
@@ -4,7 +4,7 @@
|
|
|
:style="{
|
|
|
width: viewportSize + 'px',
|
|
|
height: viewportSize * viewportRatio + 'px',
|
|
|
- transform: `scale(${scale})`,
|
|
|
+ transform: `scale(${iframeScale})`,
|
|
|
}"
|
|
|
>
|
|
|
<div class="background" :style="{ ...backgroundStyle }"></div>
|
|
|
@@ -25,7 +25,7 @@
|
|
|
import { computed, provide } from 'vue'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import { useSlidesStore } from '@/store'
|
|
|
-import type { Slide } from '@/types/slides'
|
|
|
+import { ElementTypes, type Slide } from '@/types/slides'
|
|
|
import { injectKeySlideId } from '@/types/injectKey'
|
|
|
import useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'
|
|
|
|
|
|
@@ -47,6 +47,22 @@ const { backgroundStyle } = useSlideBackgroundStyle(background)
|
|
|
|
|
|
const slideId = computed(() => props.slide.id)
|
|
|
provide(injectKeySlideId, slideId)
|
|
|
+
|
|
|
+// 判断是否包含指定类型的iframe界面
|
|
|
+const hasIframe = computed(() => {
|
|
|
+ return props.slide.elements.some(element =>
|
|
|
+ element.type === ElementTypes.FRAME &&
|
|
|
+ [72, 73, 75, 76].includes(element.toolType as number)
|
|
|
+ )
|
|
|
+})
|
|
|
+
|
|
|
+// 计算scale:如果是iframe界面且scale大于1就按1,否则按原scale
|
|
|
+const iframeScale = computed(() => {
|
|
|
+ if (hasIframe.value) {
|
|
|
+ return Math.min(props.scale, 1)
|
|
|
+ }
|
|
|
+ return props.scale
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|