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

Missing right & bottom table outer borders when inside a window without padding (1.90 regression) #7428

Open
cfillion opened this issue Mar 22, 2024 · 0 comments

Comments

@cfillion
Copy link
Contributor

cfillion commented Mar 22, 2024

Version/Branch of Dear ImGui:

1.90 - 1.90.4, since a340718

Back-ends:

Tested with example_glfw_metal, example_glfw_opengl3 & custom

Compiler, OS:

macOS

Full config/build information:

No response

Details:

Commit a340718 (1.90) draws the bottom and right borders of tables offset by 1px, beyond the expected area and potentially past the window's clip rect.

They're invisible when the table spans all available space within a child window or a normal window with no padding.

BeginTable(outer_size = ImVec2(100, 100)) produces a 101x101px table.

Screenshots/Video:

Invisible/clipped borders:
Missing borders

1px bigger than child window borders and item frames = invading into window padding and item spacing:
Inconsistent pixel
(Zoomed 3x)

Minimal, Complete and Verifiable Example code:

auto table = [] (ImVec2 size = {}) {
  if(ImGui::BeginTable("table", 2, ImGuiTableFlags_Borders /* with an S */ | ImGuiTableFlags_ScrollY, size)) {
    ImGui::TableNextRow();
    ImGui::TableNextColumn();
    ImGui::Text("Hello, world!");
    ImGui::EndTable();
  }
};

ImGui::Begin("Case 1");
ImGui::BeginChild("child");
table();
ImGui::EndChild();
ImGui::End();

ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0);
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 0, 0 });
ImGui::Begin("Case 2");
table();
ImGui::End();
ImGui::PopStyleVar(2);

ImGui::Begin("Case 3");
ImGui::BeginChild("child", { 0, 16 }, ImGuiChildFlags_Border /* without an S */); ImGui::EndChild();
table({ 0, 24 });
ImGui::Button("Test", { -FLT_MIN, 0 });
ImGui::End();
cfillion added a commit to cfillion/imgui that referenced this issue Apr 12, 2024
cfillion added a commit to cfillion/imgui that referenced this issue Apr 14, 2024
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