CAShapeLayerWithHitTest.h 925 B

123456789101112131415161718192021222324
  1. #import <Foundation/Foundation.h>
  2. #import <QuartzCore/QuartzCore.h>
  3. #import "CAShapeLayerWithClipRender.h"
  4. /*!
  5. * Overrides Apple's CAShapeLayer purely to change one method, so that hit-testing
  6. * is done by checking whether the hit point lies:
  7. *
  8. * "inside ANY part of the layer's CGPath"
  9. *
  10. * This is used exclusively by SVGShapeElement, but in theory works for any SVG*Element class that
  11. * uses CGPath to render itself.
  12. *
  13. * This is more useful than Apple's default implementation, but it might cause unexpected
  14. * problems in other code (not that I'm aware of any - this override appears to be a common
  15. * implementation, c.f. http://stackoverflow.com/questions/2944064/hit-testing-with-calayer-using-the-alpha-properties-of-the-calayer-contents
  16. *
  17. * TODO: should this layer be used in SVGEllipseElement, SVGPolygonElement, etc?
  18. */
  19. @interface CAShapeLayerWithHitTest : CAShapeLayerWithClipRender {
  20. }
  21. @end