Skip to content

Commit

Permalink
color is set for line stroke mapbox#1716
Browse files Browse the repository at this point in the history
  • Loading branch information
hallahan committed Jul 16, 2015
1 parent f911cf3 commit d6bc836
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions android/cpp/jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,11 @@ jlong JNICALL nativeAddPolyline(JNIEnv *env, jobject obj, jlong nativeMapViewPtr
env->ExceptionDescribe();
return -1;
}
++color;

int r = (color>>16)&0xFF;
int g = (color>>8)&0xFF;
int b = (color)&0xFF;
int a = (color>>24)&0xFF;

jfloat width = env->GetFloatField(polyline, polylineWidthId);
if (env->ExceptionCheck()) {
Expand All @@ -505,7 +509,7 @@ jlong JNICALL nativeAddPolyline(JNIEnv *env, jobject obj, jlong nativeMapViewPtr
mbgl::StyleProperties shapeProperties;
mbgl::LineProperties lineProperties;
lineProperties.opacity = alpha;
lineProperties.color = {{ 0.3, 0.7, 0.1, 1 }};;
lineProperties.color = {{ (float)r, (float)g, (float)b, (float)a }};
lineProperties.width = width;
shapeProperties.set<mbgl::LineProperties>(lineProperties);

Expand Down

0 comments on commit d6bc836

Please sign in to comment.