Skip to content

Commit

Permalink
Merge pull request #64 from NYTimes/develop
Browse files Browse the repository at this point in the history
Merge develop into master for 1.1.2 release
  • Loading branch information
caplan committed Jan 16, 2018
2 parents bf7b863 + e2d7140 commit d9d522a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NYT360Video.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'NYT360Video'
s.version = '1.1.1'
s.version = '1.1.2'
s.summary = 'NYT360Video plays 360º video streamed from an AVPlayer.'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.1</string>
<string>1.1.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
6 changes: 4 additions & 2 deletions Sources/NYT360CameraController.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#import "NYT360EulerAngleCalculations.h"
#import "NYT360CameraPanGestureRecognizer.h"

static const CGPoint startingPosition = { 3.14, 0 };

static inline CGFloat distance(CGPoint a, CGPoint b) {
return sqrt(pow(a.x - b.x, 2) + pow(a.y - b.y, 2));
}
Expand Down Expand Up @@ -48,7 +50,7 @@ - (instancetype)initWithView:(SCNView *)view motionManager:(id<NYT360MotionManag

_pointOfView = view.pointOfView;
_view = view;
_currentPosition = CGPointMake(3.14, 0);
_currentPosition = startingPosition;
_allowedDeviceMotionPanningAxes = NYT360PanningAxisHorizontal | NYT360PanningAxisVertical;
_allowedPanGesturePanningAxes = NYT360PanningAxisHorizontal | NYT360PanningAxisVertical;

Expand Down Expand Up @@ -116,7 +118,7 @@ - (void)updateCameraAngleForCurrentDeviceMotion {
}

static const CGFloat minimalRotationDistanceToReport = 0.75;
if (distance(CGPointZero, self.currentPosition) > minimalRotationDistanceToReport) {
if (distance(startingPosition, self.currentPosition) > minimalRotationDistanceToReport) {
[self reportInitialCameraMovementIfNeededViaMethod:NYT360UserInteractionMethodGyroscope];
}
}
Expand Down

0 comments on commit d9d522a

Please sign in to comment.