Skip to content

Commit 64416f1

Browse files
authored
fix: glyph range size (#196)
* [API] Fix glyph array size * [API] Fix macro multiple lines * [API] Fix variable to use in ImFontAtlas * [API] Fix counting of size in ImFontAtlas
1 parent 7d545c3 commit 64416f1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

imgui-binding/src/main/java/imgui/ImFontAtlas.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,10 @@ private ByteBuffer createRgba32Pixels(final int size) {
387387

388388
/*JNI
389389
#define RETURN_GLYPH_2_SHORT(glyphs) \
390-
int size = sizeof(glyphs); \
390+
const ImWchar* ranges = glyphs; \
391+
int size = 0; \
392+
for (; ranges[0]; ranges += 2) \
393+
size += 2; \
391394
jshortArray jShorts = env->NewShortArray(size); \
392395
env->SetShortArrayRegion(jShorts, 0, size, (jshort*)glyphs); \
393396
return jShorts;

0 commit comments

Comments
 (0)