DrawKit
Vector and illustration framework for Mac OS X
Instance Methods | List of all members
NSShadow(DKAdditions) Category Reference

a big annoyance with NSShadow is that it ignores the current CTM when it is set, meaning that as a drawing is scaled, the shadow stays fixed. More...

Instance Methods

(CGFloat- angle
 
(CGFloat- angleInDegrees
 
(CGFloat- distance
 
(void) - drawApproximateShadowWithPath:operation:strokeWidth:
 
(CGFloat- extraSpace
 
(void) - setAbsolute
 
(void) - setAbsoluteFlipped:
 
(void) - setAngle:
 
(void) - setAngleInDegrees:
 
(void) - setDistance:
 

Detailed Description

a big annoyance with NSShadow is that it ignores the current CTM when it is set, meaning that as a drawing is scaled, the shadow stays fixed.

This is a solution. Here, if you call setAbsolute instead of set, the parameters of the shadow are used to set a different shadow that is scaled using the current CTM, so the original shadow appears to remain at the right size as you scale.

Method Documentation

- (CGFloat) angle
- (CGFloat) angleInDegrees
- (CGFloat) distance
- (void) drawApproximateShadowWithPath: (NSBezierPath *)  path
operation: (DKShadowDrawingOperation)  op
strokeWidth: (NSInteger sw 
- (CGFloat) extraSpace
- (void) setAbsolute
- (void) setAbsoluteFlipped: (BOOL flipped
- (void) setAngle: (CGFloat radians
- (void) setAngleInDegrees: (CGFloat degrees
- (void) setDistance: (CGFloat distance