mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-07 03:48:25 +00:00
Tables: using table->InnerClipRect more consistently. Fixes an assertion with tables with borders when clipped by parent. (#6765, #3752, #7428)
This commit is contained in:
@@ -70,6 +70,7 @@ Other changes:
|
|||||||
(e.g. in our testing, handling of a 1 MB text buffer is now 3 times faster in VS2022 Debug build).
|
(e.g. in our testing, handling of a 1 MB text buffer is now 3 times faster in VS2022 Debug build).
|
||||||
This is the first step toward more refactoring. (#7925) [@alektron, @ocornut]
|
This is the first step toward more refactoring. (#7925) [@alektron, @ocornut]
|
||||||
- InputText: added CJK double-width punctuation to list of separators considered for CTRL+Arrow.
|
- InputText: added CJK double-width punctuation to list of separators considered for CTRL+Arrow.
|
||||||
|
- Tables: fixes an assertion with tables with borders when clipped by parent. (#6765, #3752, #7428)
|
||||||
- Misc: Made it accepted to call SetMouseCursor() with any out-of-bound value, as a way to allow
|
- Misc: Made it accepted to call SetMouseCursor() with any out-of-bound value, as a way to allow
|
||||||
hacking in custom cursors if desirable.
|
hacking in custom cursors if desirable.
|
||||||
- Fonts: fixed ellipsis "..." rendering width miscalculation bug introduced in 1.91.0. (#7976) [@DDeimos]
|
- Fonts: fixed ellipsis "..." rendering width miscalculation bug introduced in 1.91.0. (#7976) [@DDeimos]
|
||||||
|
@@ -1261,7 +1261,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
|
|||||||
if (table->Flags & ImGuiTableFlags_NoClip)
|
if (table->Flags & ImGuiTableFlags_NoClip)
|
||||||
table->DrawSplitter->SetCurrentChannel(inner_window->DrawList, TABLE_DRAW_CHANNEL_NOCLIP);
|
table->DrawSplitter->SetCurrentChannel(inner_window->DrawList, TABLE_DRAW_CHANNEL_NOCLIP);
|
||||||
else
|
else
|
||||||
inner_window->DrawList->PushClipRect(inner_window->InnerClipRect.Min, inner_window->InnerClipRect.Max, false);
|
inner_window->DrawList->PushClipRect(inner_window->InnerClipRect.Min, inner_window->InnerClipRect.Max, false); // FIXME: use table->InnerClipRect?
|
||||||
}
|
}
|
||||||
|
|
||||||
// Process hit-testing on resizing borders. Actual size change will be applied in EndTable()
|
// Process hit-testing on resizing borders. Actual size change will be applied in EndTable()
|
||||||
@@ -2011,7 +2011,7 @@ void ImGui::TableEndRow(ImGuiTable* table)
|
|||||||
{
|
{
|
||||||
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
for (int column_n = 0; column_n < table->ColumnsCount; column_n++)
|
||||||
table->Columns[column_n].NavLayerCurrent = ImGuiNavLayer_Main;
|
table->Columns[column_n].NavLayerCurrent = ImGuiNavLayer_Main;
|
||||||
const float y0 = ImMax(table->RowPosY2 + 1, window->InnerClipRect.Min.y);
|
const float y0 = ImMax(table->RowPosY2 + 1, table->InnerClipRect.Min.y);
|
||||||
table_instance->LastFrozenHeight = y0 - table->OuterRect.Min.y;
|
table_instance->LastFrozenHeight = y0 - table->OuterRect.Min.y;
|
||||||
|
|
||||||
if (unfreeze_rows_actual)
|
if (unfreeze_rows_actual)
|
||||||
@@ -2020,8 +2020,8 @@ void ImGui::TableEndRow(ImGuiTable* table)
|
|||||||
table->IsUnfrozenRows = true;
|
table->IsUnfrozenRows = true;
|
||||||
|
|
||||||
// BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect
|
// BgClipRect starts as table->InnerClipRect, reduce it now and make BgClipRectForDrawCmd == BgClipRect
|
||||||
table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, window->InnerClipRect.Max.y);
|
table->BgClipRect.Min.y = table->Bg2ClipRectForDrawCmd.Min.y = ImMin(y0, table->InnerClipRect.Max.y);
|
||||||
table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = window->InnerClipRect.Max.y;
|
table->BgClipRect.Max.y = table->Bg2ClipRectForDrawCmd.Max.y = table->InnerClipRect.Max.y;
|
||||||
table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen;
|
table->Bg2DrawChannelCurrent = table->Bg2DrawChannelUnfrozen;
|
||||||
IM_ASSERT(table->Bg2ClipRectForDrawCmd.Min.y <= table->Bg2ClipRectForDrawCmd.Max.y);
|
IM_ASSERT(table->Bg2ClipRectForDrawCmd.Min.y <= table->Bg2ClipRectForDrawCmd.Max.y);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user