1

I had an SVG in Adobe Illustrator that I converted to CustomPaint class using [FlutterShapeMaker][1]

I want to rotate it from the TopRight point as a fixed axis but the axis it's rotating doesn't change fixed.

Raj Dhakad
  • 852
  • 2
  • 17
  • 39
  • 1
    I think this happened because of the orientation of original svg file, edit that file and use the with he hand that is positioned vertically, not the current one with angle. – eamirho3ein Dec 18 '22 at 07:18
  • 1
    The rotation you are getting in the flutter app is the top right corner. The rotation in the first gif is not the top right corner, the rotation there is centered on the shoulder which is near the top right but not quite all the way in the top right corner. – mmcdon20 Dec 18 '22 at 07:20
  • 1
    Try changing `FractionalOffset.topRight` to `FractionalOffset(.83, .065)`, it seems to be about the right offset. – mmcdon20 Dec 18 '22 at 07:34
  • @mmcdon20 it did work, how u found right offset, any general method I can use? – Raj Dhakad Dec 18 '22 at 12:43
  • 1
    Just used a bit of trial and error. `(1, 0)` is the top right corner, and we wanted the center of the shoulder which wasn't too far off from that. So for the first value (x axis), tried `.9`, still too high, tried `.8`, too low, etc. – mmcdon20 Dec 18 '22 at 16:15
  • 1
    But if you need a more general approach, you could even just take a ruler to your screen and measure where you want it to go. For the `x` value you can just measure the distance from the left edge of the image to where you want your point to be, and divide that by the entire width of the image from left to right. Same idea on the `y` axis. – mmcdon20 Dec 18 '22 at 22:18

0 Answers0