Skip to content

Commit

Permalink
fix(pdf): top margin
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Nov 9, 2021
1 parent 303dbbd commit 359838f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
11 changes: 3 additions & 8 deletions src/components/editor/pdf/set/PDFConfigurationSetCover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
>
<div class="wb-input-container justify-start">
<label class="mx-2 text-xs">{{ t('editor.pdf.cover.type') }}</label>
<InputBoolean v-model="switcher.cover" />
<InputBoolean v-model="PDF.styles.switcher.cover" />
<InputFile
v-if="switcher.cover"
v-if="PDF.styles.switcher.cover"
id="cover-background"
:src="pdf.base.background.data"
@load="onCoverImageLoad"
Expand All @@ -32,7 +32,7 @@
<script setup lang="ts">
import { usePDFStore } from '@/store/pdf'
import { useProject } from '@/use/project'
import { reactive, computed } from 'vue'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
const PDF = usePDFStore()
Expand All @@ -42,11 +42,6 @@
const pdf = computed(() => PDF.styles)
const switcher = reactive({
cover: PDF.styles.switcher.cover,
main: PDF.styles.switcher.main,
})
const onCoverImageLoad = (e: any) => {
PDF.setCoverBackground(e)
}
Expand Down
2 changes: 1 addition & 1 deletion src/use/defines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export const useDefines = () => {
}

const pageMargins = (): Array<number> => {
return [40, 5, 40, 20]
return [40, 20, 40, 20]
}

return { pageSize, pageMargins, pageOrientation, pageSizeFixes }
Expand Down
2 changes: 1 addition & 1 deletion src/use/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export const usePDF = () => {
pageOrientation: generate().base().pageOrientation,
pageMargins: {
left: 0,
top: 0,
top: generate().base().pageMargins[1],
right: 0,
bottom: generate().base().pageMargins[3],
},
Expand Down

0 comments on commit 359838f

Please sign in to comment.