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

wrong point count for nk_fill_polygon, nk_stroke_polygon, and nk_stroke_polyline #978

Open
wedesoft opened this issue May 4, 2024 · 1 comment · May be fixed by #979
Open

wrong point count for nk_fill_polygon, nk_stroke_polygon, and nk_stroke_polyline #978

wedesoft opened this issue May 4, 2024 · 1 comment · May be fixed by #979

Comments

@wedesoft
Copy link

wedesoft commented May 4, 2024

Version

3.3.3

Platform

Linux x64

JDK

openjdk 17.0.11 2024-04-16

Module

Nuklear

Bug description

I suspect that the array size instead of the number of points (= array size divided by two) is passed to Nuklear.
Here is a Clojure snippet using a float buffer of size 6.

image

Instead of rendering a blue triangle and a white polyline, the polygon seems to be connected to the point (0, 0):

image

The nk_fill_polygon and similar methods need to be passed a point count.

This issue also has been reported here.

Stacktrace or crash log output

No response

@wedesoft
Copy link
Author

wedesoft commented May 4, 2024

Seems that points.remaining() is passed here.

wedesoft added a commit to wedesoft/lwjgl3 that referenced this issue May 5, 2024
The point count for
* stroke_polyline
* stroke_polygon
* fill_polygon
is the floating-point array size divided by two.

Closes LWJGL#978
@wedesoft wedesoft linked a pull request May 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant