1

I want to move the shape and change the direction using the arrow key. Moving was successful. But When 'rotation' is applied, the 'text' position changes. How do I keep the text position and only change the orientation of the shape?

https://codesandbox.io/s/modern-dew-d3d8em?file=/src/App.js

zhdwl
  • 13
  • 3
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 20 '22 at 02:20
  • Hard to know for sure given the brief description but you probably want to think about computing the details to rotate around the center of the blob. If you add some more explanation that would be useful maybe add an image of what you want to happen. – Vanquished Wombat Nov 23 '22 at 18:26

1 Answers1

0

You need to put the pivot point in the center of the figure and center the text too

<Circle
 ...
 offsetY={SIZE / 2} 
 offsetX={SIZE / 2}
/>

and

serg Ks
  • 1
  • 1