1
0
Fork 0

wip(lab): Work on xray mode

This commit is contained in:
Joost De Cock 2022-01-28 19:55:32 +01:00
parent c05d9dce23
commit ec2fd35208
9 changed files with 215 additions and 89 deletions

View file

@ -1,15 +1,16 @@
import TextOnPath from '../text-on-path'
import { getProps } from '../utils'
const Path = (props) => {
if (!props.path.render) return null
const Path = props => {
const { path, part, name } = props
if (!path.render) return null
const output = []
const pathId = 'path-' + props.part + '-' + props.name
const pathId = 'path-' + part + '-' + name
output.push(
<path id={pathId} key={pathId} d={props.path.asPathstring()} {...getProps(props.path)} />
<path id={pathId} key={pathId} d={path.asPathstring()} {...getProps(path)} />
)
if (props.path.attributes.get('data-text'))
output.push(<TextOnPath key={'text-on-path-' + props.name} pathId={pathId} {...props} />)
if (path.attributes.get('data-text'))
output.push(<TextOnPath key={'text-on-path-' + name} pathId={pathId} {...props} />)
return output
}