Version/Branch of Dear ImGui:
Version 1.92.8, Branch: docking (master/docking/etc.)
Back-ends:
imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp
Compiler, OS:
Windows 11 + MSVC 2022
Full config/build information:
No response
Details:
I observed two issues with table borders (when e.g. BordersInner or BordersOuter is turned on).
-
border size is not scaled. It seems hardcoded to 1.
-
It's possible to activate child rounding which is useful (used on android). But that only affects the background fill. It doesn't make outer borders round.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
Activity
5I think it's user's responsibility to layout content in a table row to look good. No special treatment needed. Rounded tables seem to be popular on android so it is good it is allowed.
I think it's user's responsibility to layout content in a table row to look good. No special treatment needed. Rounded tables seem to be popular on android so it is good it is allowed.
The reality is that:
(1) People will be tempted to use it and then stumble and report lots of issues that are difficult to fix or workaround, if not impossible. The 1 hour thing can easily become 10+ hours of support fixing esoteric cases.
(2) This tends to add complexity and CPU cost in many places. Dear ImGui job it to hide complexity away from you but those things are not magic, they are difficult to render and work with.
(3) I currently don't have a solution to make it work on non-scrolling tables, since we don't know OuterRect.Max.y ahead of time (it is being "pushed down").
Here's an unfinished patch for reference.
That is good enough! In my case rounded table will be used without an outer border. I just saw it looked weird when I accidentally turned on the border and it didn't follow the background fill which was already rounded correctly.
The inner border scaling may be more important as without it the lines are rendered too thin on high DPI display. But if it is too much work I think I can emulate it by placing separators inside the table manually.
FYI as part of work for #4678 we are closer to being able to support varying border size. It's not exposed yet but there is a chance it will be once I fix all issues discussed in #4678.
Table border size is currently hard-coded to 1.0f because a certain clip-rect merging related optimization relied on that, but I don't remember which exactly. We'll soon we going through border rendering code so I'll try to clarify this.
It's unlikely that we can properly support rounding of tables as what's on the first row may be user contents and it won't look right depending on what you submit.