rborn/TiViewShadow — comment on commit 057fbcabdc2b49d7ead989dc5f651d90ffc08df7
File:  line 0
By jaraen:

seems that this works. Not too fancy, but works.

I defined two new arguments: rasterize and shadowPath

**app.js**

```javascript
var view = Ti.UI.createView({
height:100,
width:100,
left:100,
top:10,
borderRadius:20,
backgroundColor:"green",
shadow:{
shadowRadius:10,
shadowOpacity:0.5,
shadowOffset:{x:5, y:10},
shadowPath:{x:0, y:0, width:100, height:100},
rasterize:true
}
})

```

**TiUIView+WithShadow.m**

```objective-c
-(void)setShadow_:(id)args
{
if(args != nil)
{
self.layer.masksToBounds = NO;

if ([args objectForKey:@"shadowOffset"] != nil) {
CGPoint p = [TiUtils pointValue: [args objectForKey:@"shadowOffset"]];
CGSize shadowOffset = {p.x,p.y};

self.layer.shadowOffset = shadowOffset;
}

if ([args objectForKey:@"shadowRadius"] != nil) {
self.layer.shadowRadius = [TiUtils floatValue:[args objectForKey:@"shadowRadius"]];
}

if ([args objectForKey:@"shadowOpacity"] != nil) {
self.layer.shadowOpacity = [TiUtils floatValue:[args objectForKey:@"shadowOpacity"]];
}

if ([args objectForKey:@"shadowColor"] != nil) {
UIColor * shadowColor = [[TiUtils colorValue:[args objectForKey:@"shadowColor"]] _color];
[self.layer setShadowColor:[shadowColor CGColor]];
}

if ([args objectForKey:@"shadowPath"] != nil) {
CGRect shadowRect = [TiUtils rectValue:[args objectForKey:@"shadowPath"]] ;
[self.layer setShadowPath:[[UIBezierPath bezierPathWithRect:shadowRect ] CGPath]];
}

if ([args objectForKey:@"rasterize"] != nil) {
[self.layer setShouldRasterize: [TiUtils boolValue:[args objectForKey:@"rasterize"] ]];
}

}
}
```