Skip to content

Commit

Permalink
fix(nuklear) font_atlas_bake result auto-sizing
Browse files Browse the repository at this point in the history
Close #903
  • Loading branch information
Spasi committed Jul 16, 2023
1 parent a29ef79 commit dd31017
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/notes/3.3.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This build includes the following changes:
#### Fixes

- CUDA: Fixed library name on Linux. (#884)
- Nuklear: Fixed the result auto-sizing of `nk_font_atlas_bake`. (#903)
- OpenGL: Added support for [libglvnd](https://github.com/NVIDIA/libglvnd). (#880)
* LWJGL will now try to load `libGLX.so.0` before `libGL.so.1` on Linux, matching GLFW.
* Use `Configuration.OPENGL_LIBRARY_NAME` and `GLFWNativeGLX::setPath` to override this behavior.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9847,7 +9847,7 @@ public static ByteBuffer nk_font_atlas_bake(@NativeType("struct nk_font_atlas *"
check(height, 1);
}
long __result = nnk_font_atlas_bake(atlas.address(), memAddress(width), memAddress(height), fmt);
return memByteBufferSafe(__result, width.get(width.position()) * height.get(height.position()));
return memByteBufferSafe(__result, width.get(width.position()) * height.get(height.position()) * (fmt == NK_FONT_ATLAS_RGBA32 ? 4 : 1));
}

// --- [ nk_font_atlas_end ] ---
Expand Down Expand Up @@ -10886,7 +10886,7 @@ public static ByteBuffer nk_font_atlas_bake(@NativeType("struct nk_font_atlas *"
check(height, 1);
}
long __result = nnk_font_atlas_bake(atlas.address(), width, height, fmt);
return memByteBufferSafe(__result, width[0] * height[0]);
return memByteBufferSafe(__result, width[0] * height[0] * (fmt == NK_FONT_ATLAS_RGBA32 ? 4 : 1));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5148,7 +5148,7 @@ nk_style_pop_vec2(ctx);""")}
nk_font_atlas.p("atlas", ""),
AutoSizeResult..Check(1)..int.p("width", ""),
AutoSizeResult..Check(1)..int.p("height", ""),
nk_font_atlas_format("fmt", "")
AutoSizeResult("(fmt == NK_FONT_ATLAS_RGBA32 ? 4 : 1)")..nk_font_atlas_format("fmt", "")
)

void(
Expand Down

0 comments on commit dd31017

Please sign in to comment.