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

Update imgui_internal.h #7784

Closed
wants to merge 1 commit into from
Closed

Update imgui_internal.h #7784

wants to merge 1 commit into from

Conversation

GitBruno
Copy link

Set default ImGuiItemFlags to NONE

(Click "Preview" to turn any http URL into a clickable link)

  1. PLEASE CAREFULLY READ: Contributing Guidelines

  2. Clear this template before submitting your PR.

Set default ImGuiItemFlags to NONE
@ocornut
Copy link
Owner

ocornut commented Jul 10, 2024

Why making this change?

@GitBruno
Copy link
Author

Hey Omar,

Nice to meet you. First of all thank you for this library. It is awesome.

The reason for this change is that in my opinion there is no need to break older code here. I believe this flag was added later and it would be nice if it defaults to NONE because no flags where given. It also seems to be consistent with the line below, not sure about consistency throughout the whole library though.

In the end this is a design decision, not a bug, and good either way. (I already updated my code). And I trust your decisions to keep the library lean and clean.

Thanks,

Bruno

@ocornut
Copy link
Owner

ocornut commented Jul 10, 2024

I am surprised much user code would be using ItemHoverable() at all. In my experience, 80%+ of the direct uses of this are a mistake and should be using ButtonBehavior().

Outside of very commonly used features from imgui_internal.h I would prefer to keep people on their toes understanding using those API is not providing any guarantee, and you should always be peeking around to validate your use. So I believe strategically it it better in this case as it remind people to consider their usage.

@GitBruno
Copy link
Author

Sure! That is how we all learn. It is definitely a way to educate users about a new feature. But in the end of the day it is not backwards compatible.

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 this pull request may close these issues.

2 participants