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

Issues with Modal Dialog and incorrect dimming #4863

Closed
BobbyAnguelov opened this issue Jan 4, 2022 · 4 comments
Closed

Issues with Modal Dialog and incorrect dimming #4863

BobbyAnguelov opened this issue Jan 4, 2022 · 4 comments

Comments

@BobbyAnguelov
Copy link

BobbyAnguelov commented Jan 4, 2022

Dear ImGui 1.87 WIP (18602)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=199711
define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS
define: _WIN32
define: _WIN64
define: _MSC_VER=1929
define: _MSVC_LANG=201703
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_win32
io.BackendRendererName: NULL
io.ConfigFlags: 0x00000000
io.ConfigViewportsNoDecoration
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00001C02
 HasMouseCursors
 PlatformHasViewports
 HasMouseHoveredViewport
 RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,64
io.DisplaySize: 1101.00,871.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

I've been having a really weird issue ever since I upgraded to the 1.86 version. I just rolled back to the 1.85 version to verify and the issue isn't present. I've tried to debug it but after around a day of chasing my tail, I dont understand what's going on. Everything is perfect, except for modal dialogs. The dim region is inverted and in the demo modal dialog, the 'H' from hello is missing.

I tried to repro this using the examples provided but I cant so I assume there is something on my end that's causing this, but I have no idea what that could be, I've basically stripped it down to just call NewFrame/ShowDemoWindow/EndFrame.

Does anyone have any idea what could be causing this or how to debug it. I stepped through "ImGui::RenderDimmedBackgrounds" and all the clipping rects and selection of the foremost window seems to be correct.

1.87 WIP - upgraded today in hopes it would fix the issue
image

1.85
image

@ocornut
Copy link
Owner

ocornut commented Jan 4, 2022

Same as #4845 (see comment #4845 (comment))

Your backend doesn't honor ImDrawCmd::IdxOffset correctly.
The annoying thing is that some backend didn't before 1.86 and it was never noticeable until now.
I could have done this dimming without it but I think we can take advantage of IdxOffset better for other features later.

I will edit the release note to that make more apparent.

@BobbyAnguelov
Copy link
Author

Awesome! Thanks for the hint!

I dont know why I didn't see that issue when I searched :/ Sorry for the dupe!

@ocornut
Copy link
Owner

ocornut commented Jan 4, 2022

No worries.. I suspect other people will stumble on same issues so more references are better. There was already a line in the TL;DR; section of Release Change but I added some more too:

com/ocornut/imgui/releases/tag/v1.86

image

If anything if it can encourage people to update their backend I guess it's not a total loss..

@BobbyAnguelov
Copy link
Author

Yeh, it was a really quick fix once you pointed me in the right place.

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

No branches or pull requests

2 participants