diff --git a/KYWaterWaveAnimation.xcodeproj/project.xcworkspace/xcuserdata/Riber.xcuserdatad/UserInterfaceState.xcuserstate b/KYWaterWaveAnimation.xcodeproj/project.xcworkspace/xcuserdata/Riber.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..ad50db9 Binary files /dev/null and b/KYWaterWaveAnimation.xcodeproj/project.xcworkspace/xcuserdata/Riber.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/KYWaterWaveAnimation.xcodeproj/xcuserdata/Riber.xcuserdatad/xcschemes/xcschememanagement.plist b/KYWaterWaveAnimation.xcodeproj/xcuserdata/Riber.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..75c0581 --- /dev/null +++ b/KYWaterWaveAnimation.xcodeproj/xcuserdata/Riber.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + KYWaterWaveAnimation.xcscheme + + orderHint + 0 + + + + diff --git a/KYWaterWaveAnimation/Base.lproj/Main.storyboard b/KYWaterWaveAnimation/Base.lproj/Main.storyboard index d2ae0cb..ed812c3 100644 --- a/KYWaterWaveAnimation/Base.lproj/Main.storyboard +++ b/KYWaterWaveAnimation/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -14,22 +18,23 @@ - + - - + + - + - + - - + + + @@ -38,6 +43,7 @@ + diff --git a/KYWaterWaveAnimation/KYWaterWaveView.m b/KYWaterWaveAnimation/KYWaterWaveView.m index a2d2d53..b692199 100644 --- a/KYWaterWaveAnimation/KYWaterWaveView.m +++ b/KYWaterWaveAnimation/KYWaterWaveView.m @@ -112,12 +112,12 @@ - (UIBezierPath *)getgetCurrentWavePath { CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, nil, 0, waterWaveHeight); CGFloat y = 0.0f; - for (float x = 0.0f; x <= waterWaveWidth ; x++) { + for (float x = 0.0f; x <= self.frame.size.width ; x++) { y = self.waveAmplitude* sinf((360/waterWaveWidth) *(x * M_PI / 180) - offsetX * M_PI / 180) + waterWaveHeight; CGPathAddLineToPoint(path, nil, x, y); } - CGPathAddLineToPoint(path, nil, waterWaveWidth, self.frame.size.height); + CGPathAddLineToPoint(path, nil, self.frame.size.width, self.frame.size.height); CGPathAddLineToPoint(path, nil, 0, self.frame.size.height); CGPathCloseSubpath(path); diff --git "a/\345\205\250\345\261\217\345\256\275\345\272\246\346\263\242\346\265\252\347\272\277\344\270\215\345\210\260\350\276\271\347\274\230.png" "b/\345\205\250\345\261\217\345\256\275\345\272\246\346\263\242\346\265\252\347\272\277\344\270\215\345\210\260\350\276\271\347\274\230.png" new file mode 100644 index 0000000..82a8e1e Binary files /dev/null and "b/\345\205\250\345\261\217\345\256\275\345\272\246\346\263\242\346\265\252\347\272\277\344\270\215\345\210\260\350\276\271\347\274\230.png" differ