File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed
PaperStackDemo/Vendor/PaperStack
PaperStackDemo.xcodeproj/project.xcworkspace/xcuserdata/lorenzo.xcuserdatad Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11
11
12
12
#define kPSPagePaddingRatio 0.015
13
13
#define kPSPageSideRatio 0.04
14
+ #define kPSPageTimeCorrection 0.9
14
15
15
16
#define kPSPageAnimationFriction 0.18
16
17
#define kPSPageAnimationThreshold 0.005
Original file line number Diff line number Diff line change 11
11
#import < OpenGLES/ES1/gl.h>
12
12
#import < OpenGLES/ES1/glext.h>
13
13
#import " PSDrawings.h"
14
+ #import " PSKonstants.h"
14
15
15
16
@interface PSPage ()
16
17
@@ -214,12 +215,19 @@ - (void)deformForTime:(CGFloat)t
214
215
215
216
- (void )deform
216
217
{
217
- CGFloat time = PSDistance ( SP, P ) * 0.9 ;
218
+ CGFloat time = fabs ( PSVector (SP, P).x ) * kPSPageTimeCorrection ; // iOS 5 Curl style
219
+ // CGFloat time = PSDistance( SP, P ) * kPSPageTimeCorrection; // iBooks Curl style
218
220
CGFloat angle = roundf ( ( ( PSAngle ( SP, P ) + 0.00001 ) * ( P.y > SP.y ? 1.0 : -1.0 ) + 0.00001 ) * 1000 .0f ) / 1000 .0f ;
219
221
CGFloat side = angle >= 0 ? 1.0 : -1.0 ;
220
222
BOOL upsideFlag = angle < 0 ;
221
223
CGFloat upside = upsideFlag ? 1.0 : -1.0 ;
224
+
225
+ if ( ( !hasReverseCurl && P.x < 0.0 ) || ( hasReverseCurl && P.x > 0.0 ) ) {
226
+ time = kPSPageTimeCorrection - time;
227
+ }
222
228
229
+ NSLog (@" Time:%f " ,time);
230
+
223
231
// interpolate cone base
224
232
CGFloat RB = fmax ( height/columns, ( time / M_PI ) );
225
233
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ - (id)initWithFrame:(CGRect)frame
53
53
54
54
// content view
55
55
UIView *cView = [[UIView alloc ] initWithFrame: self .bounds];
56
- cView.backgroundColor = [UIColor yellowColor ];
56
+ cView.backgroundColor = [UIColor whiteColor ];
57
57
[self addSubview: cView];
58
58
self.contentView = cView;
59
59
[cView release ];
You can’t perform that action at this time.
0 commit comments