diff --git a/packages/freesewing.shared/components/icons/filter.js b/packages/freesewing.shared/components/icons/filter.js
new file mode 100644
index 00000000000..b01ff2b564a
--- /dev/null
+++ b/packages/freesewing.shared/components/icons/filter.js
@@ -0,0 +1,7 @@
+const FilterIcon = () => (
+
+)
+
+export default FilterIcon
diff --git a/packages/freesewing.shared/components/workbench/draft/part/index.js b/packages/freesewing.shared/components/workbench/draft/part/index.js
index 33223f84cbe..3b46d52e931 100644
--- a/packages/freesewing.shared/components/workbench/draft/part/index.js
+++ b/packages/freesewing.shared/components/workbench/draft/part/index.js
@@ -3,65 +3,28 @@ import Point from '../point'
import Snippet from '../snippet'
import { getProps } from '../utils'
-const raiseEvent = (evt) => console.log('raiseEVent not implemtned', evt)
+const XrayPart = props => {
+ // Don't bother if this is the only part on display
+ if (props.gist.only && props.gist.only.length === 1) return null
+ const i = Object.keys(props.gist.xray?.reveal).indexOf(props.partName)%10
+ const { topLeft, bottomRight } = props.part
+
+ return (
+
+
+
+ )
+}
const Part = props => {
const { partName, part, app, gist, updateGist } = props
- const focusPoint = (point, i) => {
- const p = part.points[point]
- const pathString = `M ${p.x} ${part.topLeft.y} `
- + `L ${p.x} ${part.bottomRight.y} `
- + `M ${part.topLeft.x} ${p.y} `
- + `L ${part.bottomRight.x} ${p.y} `
- const classes = 'focus point c' + (i % 8) // Cycle through 8 colors
- return (
-
-
-
- raiseEvent('clearFocus', {
- part: partName,
- type: 'points',
- name: point
- })
- }
- />
-
- )
- }
-
- const focusCoords = (p, i) => {
- let pathString = `M ${p.x} ${part.topLeft.y} `
- pathString += `L ${p.x} ${part.bottomRight.y} `
- pathString += `M ${part.topLeft.x} ${p.y} `
- pathString += `L ${part.bottomRight.x} ${p.y} `
- let classes = 'focus coords c' + (i % 4) // Cycle through 4 CSS classes
- return (
-
-
-
- raiseEvent('clearFocus', {
- partName: partName,
- type: 'coords',
- data: p
- })
- }
- />
-
- )
- }
-
- let grid = gist.paperless ? (
+ const grid = gist.paperless ? (
{
/>
) : null
- let focus = []
- //if (gist.debug) {
- // if (focus && typeof props.focus[props.name] !== 'undefined') {
- // for (let i in props.focus[props.name].points)
- // focus.push(focusPoint(props.focus[props.name].points[i], i))
- // for (let i in props.focus[props.name].paths) {
- // let name = props.focus[props.name].paths[i]
- // focus.push(
- //
- // props.raiseEvent('clearFocus', {
- // part: props.name,
- // type: 'paths',
- // name
- // })
- // }
- // />
- // )
- // }
- // for (let i in props.focus[props.name].coords)
- // focus.push(focusCoords(props.focus[props.name].coords[i], i))
- // }
- //}
-
return (
{grid}
+ {props.gist?.xray?.reveal?.[partName] && }
{Object.keys(part.paths).map((pathName) => (
{
+ const r = 15 * props.gist.scale
+ const { x, y } = props.point
+ const { topLeft, bottomRight } = props.part
+ const i = Object.keys(props.gist.xray.reveal[props.partName].points).indexOf(props.pointName)%10
+ const classes = `stroke-sm stroke-color-${i} stroke-dashed`
+ return (
+
+
+
+
+ )
+ }
+
const XrayPoint = props => (
(
const Point = props => {
- const { point, pointName } = props
+ const { point, pointName, partName, gist } = props
const output = []
- if (props.gist.xray) output.push()
+ if (gist.xray) output.push()
+ if (gist.xray?.reveal?.[partName]?.points?.[pointName])
+ output.push()
if (point.attributes && point.attributes.get('data-text'))
output.push()
if (point.attributes && point.attributes.get('data-circle'))
diff --git a/packages/freesewing.shared/components/workbench/draft/svg-wrapper.js b/packages/freesewing.shared/components/workbench/draft/svg-wrapper.js
index d07da357a0c..1bbad0802e3 100644
--- a/packages/freesewing.shared/components/workbench/draft/svg-wrapper.js
+++ b/packages/freesewing.shared/components/workbench/draft/svg-wrapper.js
@@ -29,7 +29,10 @@ const SvgWrapper = props => {
const { patternProps, gist, app, updateGist, unsetGist } = props
return {({ size }) => (
-
+