diff options
author | Muller, Alexander (A.) <amulle19@ford.com> | 2016-07-17 15:17:33 -0700 |
---|---|---|
committer | Muller, Alexander (A.) <amulle19@ford.com> | 2016-07-17 15:21:23 -0700 |
commit | 4c7fc6736d262513c4bf428e43ed4fd0f0050afc (patch) | |
tree | c7bfc02d298b8eb54e2d1e99134854da25e7b77d | |
parent | 1ed1b8e331969d122def61e681dcbd54321493ba (diff) | |
download | sdl_ios-4c7fc6736d262513c4bf428e43ed4fd0f0050afc.tar.gz |
Removed duplicate function.
-rw-r--r-- | SmartDeviceLink/CGPoint_Util.h | 1 | ||||
-rw-r--r-- | SmartDeviceLink/CGPoint_Util.m | 6 | ||||
-rw-r--r-- | SmartDeviceLink/SDLTouchManager.m | 6 | ||||
-rw-r--r-- | SmartDeviceLinkTests/UtilitiesSpecs/Touches/CGPointUtilSpec.m | 15 |
4 files changed, 3 insertions, 25 deletions
diff --git a/SmartDeviceLink/CGPoint_Util.h b/SmartDeviceLink/CGPoint_Util.h index 44b247b54..c960c3bb5 100644 --- a/SmartDeviceLink/CGPoint_Util.h +++ b/SmartDeviceLink/CGPoint_Util.h @@ -12,7 +12,6 @@ #include <stdio.h> #include <CoreGraphics/CGGeometry.h> -CGPoint CGPointAverageOfPoints(CGPoint point1, CGPoint point2); CGPoint CGPointCenterOfPoints(CGPoint point1, CGPoint point2); CGPoint CGPointDisplacementOfPoints(CGPoint point1, CGPoint point2); CGFloat CGPointDistanceBetweenPoints(CGPoint point1, CGPoint point2); diff --git a/SmartDeviceLink/CGPoint_Util.m b/SmartDeviceLink/CGPoint_Util.m index d6f1743eb..5df92d5d0 100644 --- a/SmartDeviceLink/CGPoint_Util.m +++ b/SmartDeviceLink/CGPoint_Util.m @@ -9,12 +9,6 @@ #include "CGPoint_Util.h" #include "math.h" -CGPoint CGPointAverageOfPoints(CGPoint point1, CGPoint point2) { - CGFloat xAverage = (point1.x + point2.x)/2.0f; - CGFloat yAverage = (point1.y + point2.y)/2.0f; - return CGPointMake(xAverage, yAverage); -} - CGPoint CGPointCenterOfPoints(CGPoint point1, CGPoint point2) { CGFloat xCenter = (point1.x + point2.x) / 2.0f; CGFloat yCenter = (point1.y + point2.y) / 2.0f; diff --git a/SmartDeviceLink/SDLTouchManager.m b/SmartDeviceLink/SDLTouchManager.m index 3cd5ab989..01d024bdb 100644 --- a/SmartDeviceLink/SDLTouchManager.m +++ b/SmartDeviceLink/SDLTouchManager.m @@ -210,11 +210,11 @@ static NSUInteger const MaximumNumberOfTouches = 2; if (timeStampDelta <= self.tapTimeThreshold * NSEC_PER_USEC && xDelta <= self.tapDistanceThreshold && yDelta <= self.tapDistanceThreshold) { - CGPoint averagePoint = CGPointAverageOfPoints(touch.location, - self.singleTapTouch.location); + CGPoint centerPoint = CGPointCenterOfPoints(touch.location, + self.singleTapTouch.location); if ([self.touchEventListener respondsToSelector:@selector(touchManager:didReceiveDoubleTapAtPoint:)]) { [self.touchEventListener touchManager:self - didReceiveDoubleTapAtPoint:averagePoint]; + didReceiveDoubleTapAtPoint:centerPoint]; } } diff --git a/SmartDeviceLinkTests/UtilitiesSpecs/Touches/CGPointUtilSpec.m b/SmartDeviceLinkTests/UtilitiesSpecs/Touches/CGPointUtilSpec.m index a58419ee3..c39e8c6b6 100644 --- a/SmartDeviceLinkTests/UtilitiesSpecs/Touches/CGPointUtilSpec.m +++ b/SmartDeviceLinkTests/UtilitiesSpecs/Touches/CGPointUtilSpec.m @@ -25,11 +25,6 @@ describe(@"CGPoint_Util Tests", ^{ second = CGPointMake(300, 400); }); - it(@"should properly calculate the average between points", ^{ - CGPoint average = CGPointAverageOfPoints(first, second); - expect(@(average.x)).to(equal(@200)); - expect(@(average.y)).to(equal(@300)); - }); it(@"should properly calculate the center between points", ^{ CGPoint center = CGPointCenterOfPoints(first, second); expect(@(center.x)).to(equal(@200)); @@ -51,11 +46,6 @@ describe(@"CGPoint_Util Tests", ^{ second = CGPointMake(-300, -400); }); - it(@"should properly calculate the average between points", ^{ - CGPoint average = CGPointAverageOfPoints(first, second); - expect(@(average.x)).to(equal(@(-200))); - expect(@(average.y)).to(equal(@(-300))); - }); it(@"should properly calculate the center between points", ^{ CGPoint center = CGPointCenterOfPoints(first, second); expect(@(center.x)).to(equal(@(-200))); @@ -77,11 +67,6 @@ describe(@"CGPoint_Util Tests", ^{ second = CGPointMake(-300, -400); }); - it(@"should properly calculate the average between points", ^{ - CGPoint average = CGPointAverageOfPoints(first, second); - expect(@(average.x)).to(equal(@(-100))); - expect(@(average.y)).to(equal(@(-100))); - }); it(@"should properly calculate the center between points", ^{ CGPoint center = CGPointCenterOfPoints(first, second); expect(@(center.x)).to(equal(@(-100))); |