-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[core][ios][osx][android] fix icons with non-integer width/height #3561
Conversation
Approach here looks sound. I would like to continue by changing the
And replacing these
With:
|
Can you add a line to the Android and iOS sections of the changelog, too? Lots of folks are eager to see this fixed. 👏 |
Tagging myself here so that we can cherry pick this over to |
ea9ba90
to
9cef5a7
Compare
@jfirebaugh SpriteImage and PremultipliedImage changes implemented in 9cef5a7 |
9cef5a7
to
816fce3
Compare
@@ -1227,14 +1228,19 @@ void JNICALL nativeAddAnnotationIcon(JNIEnv *env, jobject obj, jlong nativeMapVi | |||
|
|||
jbyte* pixelData = env->GetByteArrayElements(jpixels, nullptr); | |||
jsize size = env->GetArrayLength(jpixels); | |||
std::string pixels(reinterpret_cast<char*>(pixelData), size); | |||
env->ReleaseByteArrayElements(jpixels, pixelData, JNI_ABORT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line needs to be moved to after the std::copy
. (Actually I'm reading now that GetByteArrayRegion
is a better API to use: http://developer.android.com/training/articles/perf-jni.html.)
@jfirebaugh thanks for finding all the bugs, they should be fixed now |
👍 |
02f3b92
to
f1fce01
Compare
the SpriteImage constructor signature changes from SpriteImage( uint16_t width, uint16_t height, float pixelRatio, std::string&& data, bool sdf = false); to SpriteImage(PremultipliedImage&&, float pixelRatio, bool sdf = false)
f1fce01
to
d34f8eb
Compare
Should this be cherry picked into the |
I verified that this fixed the initial issue of having a rectangle image as marker icon |
FYI... I fudged the cherry pick process for the first commit 26faa6a and ended up creating a new commit after resolving the changes instead of doing a |
Huge! Our mobile SDK users will be pumped when this lands. 👏 |
@danswick FYI... we had to pull this from Android |
When is the expected release of 4.0.0? |
@afathman We're still planning the specifics around |
ref #3031
ref #2198
For example, an icon that has:
is now supported.
SpriteImage is now constructed with the pixel width of the image instead of the width.
this works in android with @tobrun's https://github.com/mapbox/mapbox-gl-native/tree/3031-test-branch-android
@1ec5 I think this should fix #2198 - what's the best way to test that?