1
0
Fork 0

wip(lab): Xray for points and paths

This commit is contained in:
Joost De Cock 2022-01-29 10:50:02 +01:00
parent 243cf8efa0
commit 460e970c35
2 changed files with 24 additions and 8 deletions

View file

@ -12,9 +12,9 @@ const XrayPoint = props => (
cx={props.point.x}
cy={props.point.y}
r={7.5 * props.gist.scale}
className="fillhovertrap"
className="opacity-0 stroke-lining fill-lining hover:opacity-25 hover:cursor-pointer"
onClick={() => props.updateGist(
['xray', parts, 'props.partName', 'points', props.name],
['xray', 'parts', props.partName, 'points', props.pointName],
props.point
)}
/>
@ -23,13 +23,13 @@ const XrayPoint = props => (
const Point = props => {
const { point, name } = props
const { point, pointName } = props
const output = []
if (props.gist.xray) output.push(<XrayPoint {...props} key={'xp-' + props.name} />)
if (props.gist.xray) output.push(<XrayPoint {...props} key={'xp-' + pointName} />)
if (point.attributes && point.attributes.get('data-text'))
output.push(<Text {...props} key={'point-' + name} />)
output.push(<Text {...props} key={'point-' + pointName} />)
if (point.attributes && point.attributes.get('data-circle'))
output.push(<Circle point={point} key={'circle-' + name} />)
output.push(<Circle point={point} key={'circle-' + pointName} />)
return output.length < 1 ? null : output
}