Suppressed an uninitialized value warning from the static analyzer

While tracking the user’s location, a double tap not near the user dot now turns off location tracking instead of bouncing between the tapped location and the user location.
This commit is contained in:
Minh Nguyễn
2015-05-05 12:02:47 -04:00
parent 900d140f23
commit fc576ddef6

View File

@@ -1077,22 +1077,19 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration)
{
CGPoint doubleTapPoint = [doubleTap locationInView:doubleTap.view];
CGPoint zoomInPoint;
CGPoint zoomInPoint = doubleTapPoint;
CGPoint userPoint = [self convertCoordinate:self.userLocation.coordinate toPointToView:self];
if (self.userTrackingMode != MGLUserTrackingModeNone)
{
CGPoint userPoint = [self convertCoordinate:self.userLocation.coordinate toPointToView:self];
CGRect userLocationRect = CGRectMake(userPoint.x - 40, userPoint.y - 40, 80, 80);
if (CGRectContainsPoint(userLocationRect, doubleTapPoint))
{
zoomInPoint = userPoint;
}
}
else
if ( ! CGPointEqualToPoint(zoomInPoint, userPoint))
{
self.userTrackingMode = MGLUserTrackingModeNone;
zoomInPoint = doubleTapPoint;
}
_mbglMap->scaleBy(2, zoomInPoint.x, zoomInPoint.y, secondsAsDuration(MGLAnimationDuration));