title: How do I add Text label in CGRect?
body: <p>I have made a path, and to center it I have used <code>CGRect</code>. I want to add some text to the path at an exact position. However, since I have centered the path using <code>CGAffineTransform</code> I can't just write in the coordinates with the <code>.position</code> function.</p>
  <p>This is my path:</p>
  <pre><code>struct elevationLegend: Shape {
      func path(in rect: CGRect) -&gt; Path {
          var path = Path()
          
          path.move(to: CGPoint(x: 10, y: (100 - (90-0))))
          path.addLine(to: CGPoint(x: 10, y: (100 - (90-180))))
          
          let scale = (rect.width / 350) * (9/10)
          var xOffset = (rect.midX / 4)
          var yOffset = (rect.midY / 2)
          
          return path.applying(CGAffineTransform(scaleX: scale, y: scale)).applying(CGAffineTransform(translationX: xOffset, y: yOffset))
          
      }
  }
  </code></pre>
  <p>And this is my hopeless try of trying to position the Text.</p>
  <pre><code>struct eText: TextField {
      
      func text(in rect: CGRect) -&gt; String {
          
          let swag = Text(&quot;90&quot;).position(x: 10, y: 100 - (90-180))
          
          let scale = (rect.width / 350) * (9/10)
          var xOffset = (rect.midX / 4)
          var yOffset = (rect.midY / 2)
          
          return swag.applying(CGAffineTransform(scaleX: scale, y: scale)).applying(CGAffineTransform(translationX: xOffset, y: yOffset))
      }
  }
  </code></pre>
  <p>This dosen't work. Does anyone have an idea on how I can fix this problem</p>