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

Deprecated ImGui::Begin(...) and ImGui::SetNextWindowBgAlpha(...) handle alpha<0 differently #1568

Closed
Flix01 opened this issue Jan 24, 2018 · 4 comments

Comments

@Flix01
Copy link

Flix01 commented Jan 24, 2018

Basically, as far as I can understand, now ImGui::SetNextWindowBgAlpha(bg_alpha); is used when the deprecated version of ImGui::Begin(...,bg_alpha,...) gets called.

But now if we pass for example bg_alpha=-1.f we get a transparent window.
Previously the default alpha value of 0.7f (as far as I remember) was used.

In short I think this is breaking some old deprecated code, unless we handle negative values correctly in ImGui::SetNextWindowBgAlpha(bg_alpha);.

@ocornut
Copy link
Owner

ocornut commented Jan 24, 2018

Hmm, I think you shouldn't need/want to call SetNextWindowBgAlpha(-1.0f), perhaps we could assert for that?

Previously the default alpha value of 0.7f (as far as I remember) was used.

It was using the normal alpha from the corresponding window background color, most often ImGuiCol_WindowBg.

@ocornut
Copy link
Owner

ocornut commented Jan 24, 2018

Oh I see the problem, sorry. It is a problem when called through the old Begin() signature. Fixing now!

@Flix01
Copy link
Author

Flix01 commented Jan 24, 2018

Thank you!

@ocornut
Copy link
Owner

ocornut commented Jan 24, 2018

Fixed, my bad.

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

2 participants