weasel API - v0.8.0
    Preparing search index...

    Function clientToCanvas

    • Convert client coords to canvas CSS-pixel coords (relative to the canvas's top-left). Apps drawing in CSS-pixel space feed the result directly into world math when pan/zoom is identity. With pan/zoom, compose this with your inverse-viewport transform.

      Parameters

      • canvas: HTMLCanvasElement
      • clientX: number
      • clientY: number

      Returns [number, number]