From 18f588dc99dc1a14203dd288dfa3a5cfc103068f Mon Sep 17 00:00:00 2001 From: Enoch Riese Date: Mon, 14 Nov 2022 16:37:21 -0600 Subject: [PATCH] deepscan fixes --- .../components/workbench/layout/draft/index.js | 3 --- .../workbench/layout/print/plugin.js | 18 +++++++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/sites/shared/components/workbench/layout/draft/index.js b/sites/shared/components/workbench/layout/draft/index.js index d008e813b6c..c3aad04466d 100644 --- a/sites/shared/components/workbench/layout/draft/index.js +++ b/sites/shared/components/workbench/layout/draft/index.js @@ -1,9 +1,6 @@ import { useRef } from 'react' -import Svg from '../../draft/svg' -import Defs from '../../draft/defs' import Stack from './part' import SvgWrapper from '../../draft/svg-wrapper' -import { getProps } from '../../draft/utils' import { PartInner } from '../../draft/part' const Draft = (props) => { diff --git a/sites/shared/components/workbench/layout/print/plugin.js b/sites/shared/components/workbench/layout/print/plugin.js index 61ffacfc617..50aff7574c0 100644 --- a/sites/shared/components/workbench/layout/print/plugin.js +++ b/sites/shared/components/workbench/layout/print/plugin.js @@ -168,10 +168,10 @@ const basePlugin = ({ const [h, w] = so.size const cols = Math.ceil(so.width / w) const rows = Math.ceil(so.height / h) - const { points, Point, paths, Path, macro } = shorthand + const { points, Point, paths, Path, part, macro, store } = shorthand let count = 0 let withContent = {} - shorthand.part.topLeft = so.layout.topLeft || { x: 0, y: 0 } + part.topLeft = so.layout.topLeft || { x: 0, y: 0 } // get the layout from the pattern const { layout } = so @@ -212,9 +212,9 @@ const basePlugin = ({ if (col === cols - 1 && row === rows - 1) { const br = points[`${pageName}-br`] - shorthand.part.width = br.x - shorthand.part.height = br.y - shorthand.part.bottomRight = { x: br.x, y: br.y } + part.width = br.x + part.height = br.y + part.bottomRight = { x: br.x, y: br.y } } if (!printStyle) { @@ -227,14 +227,14 @@ const basePlugin = ({ } else { paths[pageName].attr('class', 'interfacing stroke-xs') // add markers and rulers - shorthand.macro('addPageMarkers', { row, col, pageName, withContent }, shorthand) - shorthand.macro('addRuler', { xAxis: true, pageName }, shorthand) - shorthand.macro('addRuler', { xAxis: false, pageName }, shorthand) + macro('addPageMarkers', { row, col, pageName, withContent }, shorthand) + macro('addRuler', { xAxis: true, pageName }, shorthand) + macro('addRuler', { xAxis: false, pageName }, shorthand) } } } // Store page count in part - shorthand.store.set(partName, { cols, rows, count, withContent, width: w, height: h }) + store.set(partName, { cols, rows, count, withContent, width: w, height: h }) }, /** add a ruler to the top left corner of the page */ addRuler({ xAxis, pageName }, shorthand) {