Permalink
Browse files

added changes by Javier

  • Loading branch information...
1 parent 057fbca commit 9041a7645a995554118903ca0479c1a4e8ae0d49 @rborn rborn committed Feb 24, 2012
Showing with 14 additions and 2 deletions.
  1. +11 −1 Classes/TiUIView+WithShadow.m
  2. +3 −1 example/app.js
  3. BIN ti.viewshadow-iphone-0.1.zip
@@ -33,8 +33,18 @@ -(void)setShadow_:(id)args
}
// improve performance
- [self.layer setShouldRasterize:YES ];
+
// [self.layer setShadowPath:[[UIBezierPath bezierPathWithRect:[self bounds] ] CGPath ] ]; // not working yet
+
+
+ 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"] ]];
+ }
}
}
View
@@ -12,7 +12,9 @@ var view = Ti.UI.createView({
shadow:{
shadowRadius:10,
shadowOpacity:0.5,
- shadowOffset:{x:5, y:10}
+ shadowOffset:{x:10, y:10},
+ shadowPath:{x:0, y:0, width:100, height:100}, // this improves performance a lot, and is a temporary solution until we find how to get the element's boundaries
+ rasterize:true // this should improve performance but only if there is no animation that affect the element
}
})
Binary file not shown.

0 comments on commit 9041a76

Please sign in to comment.