1
0
Fork 0

pass partname to part pieces

This commit is contained in:
Enoch Riese 2022-07-11 21:00:08 -05:00
parent 11e29e1447
commit 2e09f31c99
2 changed files with 5 additions and 5 deletions

View file

@ -78,9 +78,9 @@ const Buttons = ({ transform, flip, rotate, setRotate, resetPart }) => {
}
const Part = props => {
const { layout, name, part} = props
const { layout, part, partName} = props
const partLayout = layout.parts?.[name]
const partLayout = layout.parts?.[partName]
// Don't just assume this makes sense
if (typeof partLayout?.move?.x === 'undefined') return null
@ -176,7 +176,7 @@ const Part = props => {
const tl = domToSvg({x: partRect.left, y: partRect.top});
const br = domToSvg({x: partRect.right, y: partRect.bottom});
props.updateLayout(name, {
props.updateLayout(partName, {
move: {
x: translateX,
y: translateY,
@ -199,7 +199,7 @@ const Part = props => {
return (
<g
{...getProps(part)}
id={`part-${name}`}
id={`part-${partName}`}
ref={props.name === 'pages' ? null : partRef}
onClick={toggleDragRotate}
transform-origin={`${center.x} ${center.y}`}