diff options
author | Niklas Ulvinge <ulvinge@gmail.com> | 2015-07-20 20:34:42 +0200 |
---|---|---|
committer | Niklas Ulvinge <ulvinge@gmail.com> | 2015-07-20 20:34:42 +0200 |
commit | 42cd266aa63e7a6cfc874306c380bec5c262e0d3 (patch) | |
tree | 1caa7073714dda890427e79f2f9e43e72e1fa3bd | |
parent | ab82bdd438f1b309c56ce93d1919ffa12f8b3c02 (diff) | |
download | qtlocation-mapboxgl-42cd266aa63e7a6cfc874306c380bec5c262e0d3.tar.gz |
Correction colors transformation
-rw-r--r-- | android/cpp/jni.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp index 89a22b5027..1878beda5b 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<mbgl::LineProperties>(lineProperties); @@ -658,8 +658,8 @@ std::pair<mbgl::AnnotationSegment, mbgl::StyleProperties> 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<mbgl::FillProperties>(fillProperties); jobject points = env->GetObjectField(polygon, polygonPointsId); |