1
0
Fork 0

forgot plugin-theme

This commit is contained in:
Wouter van Wageningen 2023-04-21 04:03:39 +00:00
parent 8887a97dd2
commit 9fe51a5b77

View file

@ -37,8 +37,8 @@ export const plugin = {
}
if (paperless) {
svg.pattern.settings[0].units === 'imperial'
? (svg.defs += grid.imperial)
: (svg.defs += grid.metric)
? svg.defs.setIfUnset('grid', grid.imperial)
: svg.defs.setIfUnset('grid', grid.metric)
const parts = svg.pattern.parts[svg.pattern.activeSet]
const skipGrid = data.skipGrid || []
for (const key in parts) {
@ -48,9 +48,10 @@ export const plugin = {
let anchor = new Point(0, 0)
if (typeof points.gridAnchor !== 'undefined') anchor = part.points.gridAnchor
else if (typeof points.anchor !== 'undefined') anchor = part.points.anchor
svg.defs += `<pattern id="grid_${key}" `
svg.defs += `xlink:href="#grid" x="${anchor.x}" y="${anchor.y}">`
svg.defs += '</pattern>'
svg.defs.setIfUnset(
'grid_' + key,
`<pattern id="grid_${key}" xlink:href="#grid" x="${anchor.x}" y="${anchor.y}"></pattern>'`
)
paths[getId()] = new Path()
.move(part.topLeft)
.line(new Point(part.topLeft.x, part.bottomRight.y))