From 42cd266aa63e7a6cfc874306c380bec5c262e0d3 Mon Sep 17 00:00:00 2001 From: Niklas Ulvinge Date: Mon, 20 Jul 2015 20:34:42 +0200 Subject: [PATCH] Correction colors transformation --- android/cpp/jni.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp index 89a22b502..1878beda5 100644 --- a/android/cpp/jni.cpp +++ b/android/cpp/jni.cpp @@ -607,7 +607,7 @@ jlong JNICALL nativeAddPolyline(JNIEnv *env, jobject obj, jlong nativeMapViewPtr mbgl::StyleProperties shapeProperties; mbgl::LineProperties lineProperties; lineProperties.opacity = alpha; - lineProperties.color = {{ (float)r, (float)g, (float)b, (float)a }}; + lineProperties.color = {{ (float)r / 255.0f, (float)g / 255.0f, (float)b / 255.0f, (float)a / 255.0f }}; lineProperties.width = width; shapeProperties.set(lineProperties); @@ -658,8 +658,8 @@ std::pair readPolygon(JNIEnv *en mbgl::StyleProperties shapeProperties; mbgl::FillProperties fillProperties; fillProperties.opacity = alpha; - fillProperties.stroke_color = {{ (float)rS, (float)gS, (float)bS, (float)aS }}; - fillProperties.fill_color = {{ (float)rF, (float)gF, (float)bF, (float)aF }}; + fillProperties.stroke_color = {{ (float)rS / 255.0f, (float)gS / 255.0f, (float)bS / 255.0f, (float)aS / 255.0f }}; + fillProperties.fill_color = {{ (float)rF / 255.0f, (float)gF / 255.0f, (float)bF / 255.0f, (float)aF / 255.0f }}; shapeProperties.set(fillProperties); jobject points = env->GetObjectField(polygon, polygonPointsId);