1
0
Fork 0

move export to web worker

This commit is contained in:
Enoch Riese 2022-08-21 10:26:35 +01:00
parent df7011329b
commit 7cf7e0c90a
13 changed files with 248 additions and 133 deletions

View file

@ -7,6 +7,8 @@ import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch"
const Draft = props => {
const { draft, patternProps, gist, updateGist, app, bgProps={}, fitLayoutPart = false, layoutType="printingLayout"} = props
const svgRef = useRef(null);
if (!patternProps) return null
// keep a fresh copy of the layout because we might manipulate it without saving to the gist
let layout = draft.settings.layout === true ? {
...patternProps.autoLayout,
@ -14,9 +16,7 @@ const Draft = props => {
height: patternProps.height
} : {...draft.settings.layout}
const svgRef = useRef(null);
if (!patternProps) return null
// Helper method to update part layout and re-calculate width * height
const updateLayout = (name, config, history=true) => {