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

Loss of Rounded Corners in ImGui Menu when Moved Outside Main Viewport #6599

Closed
Gauxalot opened this issue Jul 12, 2023 · 2 comments
Closed

Comments

@Gauxalot
Copy link

Dear ImGui 1.89.8 WIP (18973)
--------------------------------
sizeof(size_t): 8, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=199711
define: _WIN32
define: _WIN64
define: _MSC_VER=1935
define: _MSVC_LANG=201402
define: IMGUI_HAS_VIEWPORT
define: IMGUI_HAS_DOCK
--------------------------------
io.BackendPlatformName: imgui_impl_win32
io.BackendRendererName: imgui_impl_dx11
io.ConfigFlags: 0x00000443
 NavEnableKeyboard
 NavEnableGamepad
 DockingEnable
 ViewportsEnable
io.ConfigViewportsNoDecoration
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00001C0E
 HasMouseCursors
 HasSetMousePos
 PlatformHasViewports
 HasMouseHoveredViewport
 RendererHasVtxOffset
 RendererHasViewports
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,64
io.DisplaySize: 1264.00,761.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

Version/Branch of Dear ImGui:

Version: 1.89.8 WIP
Branch: docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_dx11.cpp + imgui_impl_win32.cpp
Compiler: MSVC
Operating System: Windows 11

My Issue/Question:

Description: When I move the ImGui menu outside the window in my application, the menu loses its rounded corners and appears with straight edges.

style.WindowRounding = 20.0f;

Expected Behavior:
When the ImGui menu is moved outside the application window, the menu should retain its rounded corners, providing a consistent visual appearance regardless of its position.

Additional Information:
I have downloaded the docking branch of Dear ImGui (version 1.89.8 WIP) and integrated it into my application. The rounding of other UI elements, such as windows, is functioning correctly. The issue only occurs specifically with the ImGui menu when moved outside the application window.

Any guidance or suggestions on how to resolve this issue would be greatly appreciated.

Thank you for your attention to this matter.

Screenshots/Video
preview

@GamingMinds-DanielC
Copy link
Contributor

That's not a bug, just an unfortunate limitation of secondary viewports. It is (currently) impossible to have them rounded as well. Might be best to not use rounding if you use viewports and want to have a consistent look.

@ocornut ocornut changed the title Loss of Rounded Corners in ImGui Menu when Moved Outside Window Loss of Rounded Corners in ImGui Menu when Moved Outside Main Viewport Jul 13, 2023
@ocornut
Copy link
Owner

ocornut commented Jul 13, 2023

Your are capturing from the DirectX11 example showing you modified the value of style.WindowRounding.
There's code and a comment in every example's main that sets back WindowRounding to 0.0f for this reason.

See #4180 #6298

Work on #2766 may make this possible in the future but may be costly and not simple to maintain cross platform.

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

3 participants