title: How do I get base-space transform from CGContext?
body: <p>The offset for <code>CGContext.setShadow</code> has to be specified in base-space:</p>
  <blockquote>
  <p>offset - Specifies a translation in base-space.</p>
  </blockquote>
  <p>(from <a href="https://developer.apple.com/documentation/coregraphics/cgcontext/1455205-setshadow" rel="nofollow noreferrer">https://developer.apple.com/documentation/coregraphics/cgcontext/1455205-setshadow</a>)</p>
  <p><strong>What is this &quot;base-space&quot;?</strong></p>
  <p>Semi related docs have this explanation:</p>
  <blockquote>
  <ul>
  <li>The drawing (user) coordinate system. This coordinate system is used when you issue drawing commands.</li>
  <li>The view coordinate system (base space). This coordinate system is a fixed coordinate system relative to the view.</li>
  <li>The (physical) device coordinate system. This coordinate system represents pixels on the physical screen.</li>
  </ul>
  </blockquote>
  <p>(from: <a href="https://developer.apple.com/library/archive/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html" rel="nofollow noreferrer">https://developer.apple.com/library/archive/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html</a>)</p>
  <p>This makes sense. However, <strong>how do I get the transform of this base-space?</strong> There is <code>CGContext.userSpaceToDeviceSpaceTransform</code> but it seems to be transform from user-&gt;physical. How do I get from user-&gt;base or base-&gt;physical?</p>