|
@@ -460,16 +460,27 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|
|
temp_data->HostBackupItemWidthStackSize = outer_window->DC.ItemWidthStack.Size;
|
|
|
inner_window->DC.PrevLineSize = inner_window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
|
|
|
|
|
|
- // Make left and top borders not overlap our contents by offsetting HostClipRect (#6765)
|
|
|
+ // Make borders not overlap our contents by offsetting HostClipRect (#6765, #7428, #3752)
|
|
|
// (we normally shouldn't alter HostClipRect as we rely on TableMergeDrawChannels() expanding non-clipped column toward the
|
|
|
// limits of that rectangle, in order for ImDrawListSplitter::Merge() to merge the draw commands. However since the overlap
|
|
|
// problem only affect scrolling tables in this case we can get away with doing it without extra cost).
|
|
|
if (inner_window != outer_window)
|
|
|
{
|
|
|
+ // FIXME: Because inner_window's Scrollbar doesn't know about border size, since it's not encoded in window->WindowBorderSize,
|
|
|
+ // it already overlaps it and doesn't need an extra offset. Ideally we should be able to pass custom border size with
|
|
|
+ // different x/y values to BeginChild().
|
|
|
if (flags & ImGuiTableFlags_BordersOuterV)
|
|
|
+ {
|
|
|
table->HostClipRect.Min.x = ImMin(table->HostClipRect.Min.x + TABLE_BORDER_SIZE, table->HostClipRect.Max.x);
|
|
|
+ if (inner_window->DecoOuterSizeX2 == 0.0f)
|
|
|
+ table->HostClipRect.Max.x = ImMax(table->HostClipRect.Max.x - TABLE_BORDER_SIZE, table->HostClipRect.Min.x);
|
|
|
+ }
|
|
|
if (flags & ImGuiTableFlags_BordersOuterH)
|
|
|
+ {
|
|
|
table->HostClipRect.Min.y = ImMin(table->HostClipRect.Min.y + TABLE_BORDER_SIZE, table->HostClipRect.Max.y);
|
|
|
+ if (inner_window->DecoOuterSizeY2 == 0.0f)
|
|
|
+ table->HostClipRect.Max.y = ImMax(table->HostClipRect.Max.y - TABLE_BORDER_SIZE, table->HostClipRect.Min.y);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// Padding and Spacing
|
|
@@ -497,7 +508,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
|
|
|
table->InnerClipRect = (inner_window == outer_window) ? table->WorkRect : inner_window->ClipRect;
|
|
|
table->InnerClipRect.ClipWith(table->WorkRect); // We need this to honor inner_width
|
|
|
table->InnerClipRect.ClipWithFull(table->HostClipRect);
|
|
|
- table->InnerClipRect.Max.y = (flags & ImGuiTableFlags_NoHostExtendY) ? ImMin(table->InnerClipRect.Max.y, inner_window->WorkRect.Max.y) : inner_window->ClipRect.Max.y;
|
|
|
+ table->InnerClipRect.Max.y = (flags & ImGuiTableFlags_NoHostExtendY) ? ImMin(table->InnerClipRect.Max.y, inner_window->WorkRect.Max.y) : table->HostClipRect.Max.y;
|
|
|
|
|
|
table->RowPosY1 = table->RowPosY2 = table->WorkRect.Min.y; // This is needed somehow
|
|
|
table->RowTextBaseline = 0.0f; // This will be cleared again by TableBeginRow()
|
|
@@ -1249,7 +1260,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|
|
if (table->Flags & ImGuiTableFlags_NoClip)
|
|
|
table->DrawSplitter->SetCurrentChannel(inner_window->DrawList, TABLE_DRAW_CHANNEL_NOCLIP);
|
|
|
else
|
|
|
- inner_window->DrawList->PushClipRect(inner_window->ClipRect.Min, inner_window->ClipRect.Max, false);
|
|
|
+ inner_window->DrawList->PushClipRect(inner_window->InnerClipRect.Min, inner_window->InnerClipRect.Max, false);
|
|
|
}
|
|
|
|
|
|
// Process hit-testing on resizing borders. Actual size change will be applied in EndTable()
|