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

Closed
wedesoft opened this issue May 4, 2024 · 2 comments · Fixed by #979
Closed

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

wedesoft opened this issue May 4, 2024 · 2 comments · Fixed by #979

Comments

@wedesoft
Copy link
Contributor

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
Contributor Author

wedesoft commented May 4, 2024

Seems that points.remaining() is passed here.

@Spasi Spasi added the Type: Bug label Jun 4, 2024
@Spasi Spasi closed this as completed in #979 Jun 4, 2024
Spasi pushed a commit that referenced this issue Jun 4, 2024
The point count for

* stroke_polyline
* stroke_polygon
* fill_polygon

is the floating-point array size divided by two.

Close #978
@Spasi
Copy link
Member

Spasi commented Jun 4, 2024

Thanks @wedesoft!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants