1
0
Fork 0

get pages to render properly on pdf export when settings.only is an array

This commit is contained in:
Enoch Riese 2022-12-13 08:39:16 -06:00
parent b12696dcfa
commit 4bdbddb3d6
3 changed files with 20 additions and 2 deletions

View file

@ -165,6 +165,22 @@ const basePlugin = ({
pattern.height = sheetHeight * generatedPageData.rows
}
},
preRender: function (svg) {
const pattern = svg.pattern
const only = pattern.settings[pattern.activeStack || 0].only
// add the layout part to the include list if there is one so that it gets rendered
if (Array.isArray(only) && !only.includes(partName)) {
pattern.settings[pattern.activeStack || 0].only.push(partName)
}
},
postRender: function (svg) {
const pattern = svg.pattern
const only = pattern.settings[pattern.activeStack || 0].only
// remove the layout part from the include list if there is one so that we don't pollute the settings
if (Array.isArray(only) && only.includes(partName)) {
pattern.settings[pattern.activeStack || 0].only.splice(only.indexOf(partName), 1)
}
},
},
macros: {
/** draft the pages */