Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Nuklear): wrong autogenerated point count #979

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/notes/3.3.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ This build includes the following changes:
- Core: Fixed callback wrapper memory leak with the CHM closure registry. (#927)
- LLVM: Fixed `LLVMGetBufferStart` to return `ByteBuffer` instead of `String`. (#934)
- LLVM: Fixed `LookupIntrinsicID` to return `unsigned` instead of `void`. (#950)
- Nuklear: Fixed auto-sizing of `nk_stroke_polyline`, `nk_stroke_polygon`, `nk_fill_polygon` buffers. (#978)
- tinyfd: The `aDefaultPath` parameter of `tinyfd_selectFolderDialog` is now nullable. (#922)

#### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9003,15 +9003,15 @@ public static void nk_stroke_triangle(@NativeType("struct nk_command_buffer *")
public static native void nnk_stroke_polyline(long b, long points, int point_count, float line_thickness, long col);

public static void nk_stroke_polyline(@NativeType("struct nk_command_buffer *") NkCommandBuffer b, @NativeType("float *") FloatBuffer points, float line_thickness, @NativeType("struct nk_color") NkColor col) {
nnk_stroke_polyline(b.address(), memAddress(points), points.remaining(), line_thickness, col.address());
nnk_stroke_polyline(b.address(), memAddress(points), points.remaining() >> 1, line_thickness, col.address());
}

// --- [ nk_stroke_polygon ] ---

public static native void nnk_stroke_polygon(long b, long points, int point_count, float line_thickness, long color);

public static void nk_stroke_polygon(@NativeType("struct nk_command_buffer *") NkCommandBuffer b, @NativeType("float *") FloatBuffer points, float line_thickness, @NativeType("struct nk_color") NkColor color) {
nnk_stroke_polygon(b.address(), memAddress(points), points.remaining(), line_thickness, color.address());
nnk_stroke_polygon(b.address(), memAddress(points), points.remaining() >> 1, line_thickness, color.address());
}

// --- [ nk_fill_rect ] ---
Expand Down Expand Up @@ -9059,7 +9059,7 @@ public static void nk_fill_triangle(@NativeType("struct nk_command_buffer *") Nk
public static native void nnk_fill_polygon(long b, long points, int point_count, long color);

public static void nk_fill_polygon(@NativeType("struct nk_command_buffer *") NkCommandBuffer b, @NativeType("float *") FloatBuffer points, @NativeType("struct nk_color") NkColor color) {
nnk_fill_polygon(b.address(), memAddress(points), points.remaining(), color.address());
nnk_fill_polygon(b.address(), memAddress(points), points.remaining() >> 1, color.address());
}

// --- [ nk_draw_image ] ---
Expand Down Expand Up @@ -10871,23 +10871,23 @@ public static ByteBuffer nk_str_at_const(@NativeType("struct nk_str const *") Nk

/** Array version of: {@link #nk_stroke_polyline stroke_polyline} */
public static void nk_stroke_polyline(@NativeType("struct nk_command_buffer *") NkCommandBuffer b, @NativeType("float *") float[] points, float line_thickness, @NativeType("struct nk_color") NkColor col) {
nnk_stroke_polyline(b.address(), points, points.length, line_thickness, col.address());
nnk_stroke_polyline(b.address(), points, points.length >> 1, line_thickness, col.address());
}

/** Array version of: {@link #nnk_stroke_polygon} */
public static native void nnk_stroke_polygon(long b, float[] points, int point_count, float line_thickness, long color);

/** Array version of: {@link #nk_stroke_polygon stroke_polygon} */
public static void nk_stroke_polygon(@NativeType("struct nk_command_buffer *") NkCommandBuffer b, @NativeType("float *") float[] points, float line_thickness, @NativeType("struct nk_color") NkColor color) {
nnk_stroke_polygon(b.address(), points, points.length, line_thickness, color.address());
nnk_stroke_polygon(b.address(), points, points.length >> 1, line_thickness, color.address());
}

/** Array version of: {@link #nnk_fill_polygon} */
public static native void nnk_fill_polygon(long b, float[] points, int point_count, long color);

/** Array version of: {@link #nk_fill_polygon fill_polygon} */
public static void nk_fill_polygon(@NativeType("struct nk_command_buffer *") NkCommandBuffer b, @NativeType("float *") float[] points, @NativeType("struct nk_color") NkColor color) {
nnk_fill_polygon(b.address(), points, points.length, color.address());
nnk_fill_polygon(b.address(), points, points.length >> 1, color.address());
}

/** Array version of: {@link #nnk_font_atlas_bake} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4410,7 +4410,7 @@ nk_style_pop_vec2(ctx);""")}

cmd,
float.p("points", ""),
AutoSize("points")..int("point_count", ""),
AutoSizeShr("1", "points")..int("point_count", ""),
float("line_thickness", ""),
nk_color("col", "")
)
Expand All @@ -4421,7 +4421,7 @@ nk_style_pop_vec2(ctx);""")}

cmd,
float.p("points", ""),
AutoSize("points")..int("point_count", ""),
AutoSizeShr("1", "points")..int("point_count", ""),
float("line_thickness", ""),
nk_color("color", "")
)
Expand Down Expand Up @@ -4490,7 +4490,7 @@ nk_style_pop_vec2(ctx);""")}

cmd,
float.p("points", ""),
AutoSize("points")..int("point_count", ""),
AutoSizeShr("1", "points")..int("point_count", ""),
nk_color("color", "")
)

Expand Down