     case NSEventPhase.began:
       let pinchImageRep = self.bitmapImageRepForCachingDisplay(in: self.bounds)!
       self.cacheDisplay(in: self.bounds, to: pinchImageRep)
-      self.pinchImage = NSImage()
-      self.pinchImage.addRepresentation(pinchImageRep)
+      self.pinchBitmap = pinchImageRep
 
       self.isCurrentlyPinching = true
       self.needsDisplay = true

    let context = NSGraphicsContext.current()!.cgContext

    if self.isCurrentlyPinching {
      let boundsSize = self.bounds.size
      let targetSize = CGSize(width: boundsSize.width * self.pinchTargetScale,
                              height: boundsSize.height * self.pinchTargetScale)
      self.pinchImage.draw(in: CGRect(origin: self.bounds.origin, size: targetSize))
      return
    }



  fileprivate var isCurrentlyPinching = false
  fileprivate var pinchTargetScale = CGFloat(1)
  fileprivate var pinchBitmap: NSBitmapImageRep?

  fileprivate var currentlyResizing = false
  fileprivate var currentEmoji = "😎"
