diff options
Diffstat (limited to 'platform/darwin/src/MGLGeometry_Private.h')
-rw-r--r-- | platform/darwin/src/MGLGeometry_Private.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/platform/darwin/src/MGLGeometry_Private.h b/platform/darwin/src/MGLGeometry_Private.h index b91d4e0f81..a89a382c5e 100644 --- a/platform/darwin/src/MGLGeometry_Private.h +++ b/platform/darwin/src/MGLGeometry_Private.h @@ -97,14 +97,24 @@ NS_INLINE BOOL MGLLocationCoordinate2DIsValid(CLLocationCoordinate2D coordinate) } #if TARGET_OS_IPHONE -NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(UIEdgeInsets insets) { - return { insets.top, insets.left, insets.bottom, insets.right }; -} + #define MGLEdgeInsets UIEdgeInsets + #define MGLEdgeInsetsMake UIEdgeInsetsMake #else -NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(NSEdgeInsets insets) { + #define MGLEdgeInsets NSEdgeInsets + #define MGLEdgeInsetsMake NSEdgeInsetsMake +#endif + +NS_INLINE mbgl::EdgeInsets MGLEdgeInsetsFromNSEdgeInsets(MGLEdgeInsets insets) { return { insets.top, insets.left, insets.bottom, insets.right }; } -#endif + +/// Returns the combination of two edge insets. +NS_INLINE MGLEdgeInsets MGLEdgeInsetsInsetEdgeInset(MGLEdgeInsets base, MGLEdgeInsets inset) { + return MGLEdgeInsetsMake(base.top + inset.top, + base.left + inset.left, + base.bottom + inset.bottom, + base.right + inset.right); +} /** Returns MGLRadianCoordinate2D, converted from CLLocationCoordinate2D. */ NS_INLINE MGLRadianCoordinate2D MGLRadianCoordinateFromLocationCoordinate(CLLocationCoordinate2D locationCoordinate) { |