title: Drawing shadow around NSImageView
body: <p>I'm trying to draw shadow under an <code>NSImageView</code>. I'm accessing the <code>CALayer</code> of the view and setting its shadow properties there:</p>
  
  <pre><code>[self.originalImageView setWantsLayer:YES];
  CALayer *imageLayer = self.originalImageView.layer;
  [imageLayer setShadowRadius:5.f];
  [imageLayer setShadowOffset:CGSizeZero];
  [imageLayer setShadowOpacity:0.5f];
  [imageLayer setShadowColor:CGColorCreateGenericGray(0, 1)];
  imageLayer.masksToBounds = NO;
  </code></pre>
  
  <p>But even though I have set masks to bounds as NO, I'm getting this:</p>
  
  <p><img src="https://i.stack.imgur.com/WiI2F.png" alt="enter image description here"></p>
  
  <p>Look carefully at the shadow. It is displayed perfectly horizontally, but vertically, it's clipped. The image is aspect-fitted, and both the image and the image view can be arbitrary size. If I try it with <code>NSShadow</code> instead of layer's shadow, I'm getting exactly the same results. I could use <code>myView.clipsToBounds = NO</code> in iOS and it used to solve this problem, however I can't find that property on Mac.</p>
  
  <p>How can I draw shadow under arbitrary-sized <code>NSImageView</code> without clipping?</p>