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

Incorrect stroke when AntiAliasing is OFF #701

Open
ryuukk opened this issue Sep 24, 2024 · 6 comments
Open

Incorrect stroke when AntiAliasing is OFF #701

ryuukk opened this issue Sep 24, 2024 · 6 comments

Comments

@ryuukk
Copy link
Contributor

ryuukk commented Sep 24, 2024

Happens on all backends

  • on the button: notice the left part of the stroke is not drawn
  • on the window: notice the 1px stroke on the left, and 2px stroke on the top

image

Someone kept merging PRs without testing AA setting, no bueno

@RobLoach
Copy link
Contributor

I've seen this too, and I'm not entirely sure where it popped up.

@RobLoach
Copy link
Contributor

Confirmed...

diff --git a/demo/glfw_opengl3/main.c b/demo/glfw_opengl3/main.c
index 0b6431a..9e30679 100644
--- a/demo/glfw_opengl3/main.c
+++ b/demo/glfw_opengl3/main.c
@@ -192,7 +192,7 @@ int main(void)
          * defaults everything back into a default state.
          * Make sure to either a.) save and restore or b.) reset your own state after
          * rendering the UI. */
-        nk_glfw3_render(&glfw, NK_ANTI_ALIASING_ON, MAX_VERTEX_BUFFER, MAX_ELEMENT_BUFFER);
+        nk_glfw3_render(&glfw, NK_ANTI_ALIASING_OFF, MAX_VERTEX_BUFFER, MAX_ELEMENT_BUFFER);
         glfwSwapBuffers(win);
     }
     nk_glfw3_shutdown(&glfw);

Screenshot from 2024-09-24 23-04-44

@RobLoach
Copy link
Contributor

RobLoach commented Sep 25, 2024

I've gone all the back to April, 2020 at b939d43 , and still can't find when this was actually working 🤔

@ryuukk
Copy link
Contributor Author

ryuukk commented Sep 25, 2024

I figured it out for the button, it's the scissor rect doesn't take into account the border

If i add (randomly) -10 to the x value of the scissor's rect, then it shows properly

image

As for the window, i have no clue, but it perhaps is the same issue?

This whole border thing is fishy to me, why doesn't it affect the layout of widgets currently?

@ryuukk
Copy link
Contributor Author

ryuukk commented Sep 25, 2024

Besides, plenty of areas where border impact widget's area even thought the property is not used when drying widgets with images

image

@AnaIytics
Copy link

off topic and sorry, but what VS theme r u using?

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

No branches or pull requests

3 participants