[ios] Simplify and (internally) document MGLPointRounded()
`UIScreen.nativeScale` is available beginning in iOS 8, so the conditional is no longer necessary.
This commit is contained in:
@@ -98,7 +98,7 @@ CLLocationDirection MGLDirectionBetweenCoordinates(CLLocationCoordinate2D firstC
|
||||
|
||||
CGPoint MGLPointRounded(CGPoint point) {
|
||||
#if TARGET_OS_IPHONE || TARGET_OS_SIMULATOR
|
||||
CGFloat scaleFactor = [UIScreen instancesRespondToSelector:@selector(nativeScale)] ? [UIScreen mainScreen].nativeScale : [UIScreen mainScreen].scale;
|
||||
CGFloat scaleFactor = [UIScreen mainScreen].nativeScale;
|
||||
#elif TARGET_OS_MAC
|
||||
CGFloat scaleFactor = [NSScreen mainScreen].backingScaleFactor;
|
||||
#endif
|
||||
|
||||
@@ -138,6 +138,9 @@ MGLRadianCoordinate2D MGLRadianCoordinateAtDistanceFacingDirection(MGLRadianCoor
|
||||
*/
|
||||
CLLocationDirection MGLDirectionBetweenCoordinates(CLLocationCoordinate2D firstCoordinate, CLLocationCoordinate2D secondCoordinate);
|
||||
|
||||
/**
|
||||
Returns a point with coordinates rounded to the nearest logical pixel.
|
||||
*/
|
||||
CGPoint MGLPointRounded(CGPoint point);
|
||||
|
||||
MGLMatrix4 MGLMatrix4Make(std::array<double, 16> mat);
|
||||
|
||||
Reference in New Issue
Block a user