-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Removed column skip items assert #7957
Conversation
because IsVisibleY was changed to always be true for columns and is_visible changed to only care about the X-axis, the assert for is_visible on if the column items should be skipped is now an erroneous assert because of the case where the column is part of a table that has clipped off the top or bottom of the cliprect. In those cases, is_visible will always be true (horizontally) but hostSkipItems will be false.
Thank you! Could you clarify where this could be reproed in the Demo? Or maybe a gif from Tables>Advanced. |
I'm so sorry I spent a lot of time trying to get it to repro in the demo but it's proving really challenging. The bad assert happens in the somehow case of the early-out outer_size clip check doesnt return true: Lines 334 to 339 in a5cf4fe
but then in the same frame when the child window gets created, that window turns out to be clipped and returns false: Lines 414 to 421 in a5cf4fe
This So sorry to bother you with this, I thought I had it fully nailed down but this assert isnt as obviously an error as it seems, Im just going to remove it on my own fork and the fate of this PR isn't important |
I will investigate this. Everything is important :) thanks for reporting. |
Basically I don't want to remove an assert without strongly understanding the issue at play. If you feel you can share a video it would help me understand the context at a glance, and if you think you can manufacture a custom I would greatly appreciate it (I can turn this repro into a regression test case as well). I appreciate your report. |
I made a video to try and show as much debugging data for it as possible: https://www.youtube.com/watch?v=Gy-7lXvfxak This is using a modified version of ImNodes It would be best if I could repro this in regular imgui demo to rule out the node canvas or any changes we made on our side, but the code for that video is simple within the canvas BeginNode/EndNode: auto dpiAndZoom = ImGui::ecl::GetContentScale();
if (ImGui::BeginTable("Table", 3, ImGuiTableFlags_ScrollY, ImVec2(200.0f * dpiAndZoom, 200.0f * dpiAndZoom))) {
ImGui::TableSetupColumn("A");
ImGui::TableSetupColumn("B");
ImGui::TableSetupColumn("C");
ImGui::TableHeadersRow();
for (int i = 0; i < 100; ++i) {
for (int j = 0; j < 3; ++j) {
ImGui::TableNextColumn();
ImGui::TextUnformatted("hi");
}
}
ImGui::EndTable();
} ImNodes scales all the style vars by a zoom amount, and we multiple that zoom and dpi scale to make the outer_size of the table correct. I did find that if I didnt do the dpiandzoom scale in the above example the table obviously doesnt zoom but also the assert doesnt happen... so maybe some mismatch with outer_size changing or maybe floating point issue edit: so sorry heres the build info:
|
…izes are not rounded. (#7957)
Hello Brianna, I have investigated this and my conclusion for now is that I'd rather fix the issue at the source which is the mismatch between the I do believe it is likely that there are other cases that may requires further adjustments closer to the the assert you mentioned, but for now I would prefer to avoid removing it to avoid situation where a table is needlessly iterated on. |
@ocornut Thank you so much! Your fix resolves the issue for my use cases. I definitely was expecting removing the assert to be the wrong fix after everything we learned here, I'm so glad you were able to find the right fix! I'll close this PR, have a nice day! |
because IsVisibleY was changed to always be true for columns and is_visible changed to only care about the X-axis, the assert for is_visible on if the column items should be skipped is now an erroneous assert because of the case where the column is part of a table that has clipped off the top or bottom of the cliprect. In those cases, is_visible will always be true (horizontally) but hostSkipItems will be false.