anchor.diff:    (%nvg:translate (handle-value-of canvas) 0f0 (f (- (height-of canvas)))))
   
   
  -(defun begin-canvas (canvas &optional pixel-ratio)
  +(defun begin-canvas (canvas)
     (%nvg:begin-frame (handle-value-of canvas) (width-of canvas) (height-of canvas)
  -                    (or pixel-ratio (pixel-ratio-of canvas)))
  +                    (pixel-ratio-of canvas))
     (%invert-coordinate-system canvas))
   
   
  
positive.code: (in-package :cl-bodge.canvas)
  
  
  (declaim (special *canvas*)
           (special *pixel-ratio*))
  
  
  (defhandle canvas-handle
  
negative.code:   (reset-state))
  
  
  (defun flush-canvas (&optional (canvas *canvas*))
    (end-canvas canvas)
    (begin-canvas canvas))
  
  
  (defmacro with-canvas ((canvas) &body body)
    (once-only (canvas)
      `(let ((*canvas* ,canvas))
         (unwind-protect
              (progn
                (begin-canvas *canvas*)
                ,@body)
           (end-canvas *canvas*)))))
  
  