Search code examples
delphivectorfiremonkey

How to rotate TPathData (vector path)?


I have TPathData arrow and draw directly on Canvas. How to rotate TPathData? I know about rotating Tpath but I draw directly on Canvas (lines and arrows). I tried to rotate Tpath and the get Data string - but it is the same as before.


Solution

  • You have to create a rotation matrix and then apply it.

    M := TMatrix.CreateRotation(DegToRad(90));  
    PathData.ApplyMatrix(M);