2023-06-01 18:28:22 +02:00
|
|
|
import React from 'react'
|
|
|
|
|
2025-05-25 16:29:57 +02:00
|
|
|
/**
|
|
|
|
* A component to render the grid for a paperless FreeSewing pattern' stack
|
|
|
|
*
|
|
|
|
* @component
|
|
|
|
* @param {object} props - All component props
|
|
|
|
* @param {Stack} props.stack - The FreeSewing Stack object for the pattern
|
|
|
|
* @param {string} props.stackName - The name of the FreeSewing Stack
|
|
|
|
* @returns {JSX.Element}
|
|
|
|
*/
|
2023-06-04 17:28:02 +02:00
|
|
|
export const Grid = ({ stack, stackName }) => (
|
2023-06-01 18:28:22 +02:00
|
|
|
<rect
|
2023-06-04 17:28:02 +02:00
|
|
|
x={stack.topLeft.x}
|
|
|
|
y={stack.topLeft.y}
|
|
|
|
width={stack.width}
|
|
|
|
height={stack.height}
|
2023-06-01 18:28:22 +02:00
|
|
|
className="grid"
|
2023-06-04 17:28:02 +02:00
|
|
|
fill={'url(#grid-' + stackName + ')'}
|
2023-06-01 18:28:22 +02:00
|
|
|
/>
|
|
|
|
)
|