diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/Utils.java')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/Utils.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/Utils.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/Utils.java index 49f9a7c43c..b352dc9190 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/Utils.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/Utils.java @@ -36,6 +36,16 @@ public final class Utils { return heading; } + /** + * Normalizes an angle to be in the [0, 360] range. + * + * @param angle the provided angle + * @return the normalized angle + */ + public static float normalize(float angle) { + return (angle % 360 + 360) % 360; + } + static Bitmap generateShadow(Drawable drawable, float elevation) { int width = drawable.getIntrinsicWidth(); int height = drawable.getIntrinsicHeight(); |