mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-28 12:06:39 +08:00
Tables: fixed an issue reporting ideal size to parent window/container when both scrollbars are visible but only one of ScrollX/ScrollY was explicitly requested. (#9352, #7651)
Since ScrollX de-facto also enables ScrollY we can't gate accounting for ScrollbarSizes.x based on explicit ScrollY.
Amend a31aa683f
This commit is contained in:
@@ -46,6 +46,9 @@ Other Changes:
|
|||||||
- InputText:
|
- InputText:
|
||||||
- InputTextMultiline: fixed an issue processing deactivation logic when an active
|
- InputTextMultiline: fixed an issue processing deactivation logic when an active
|
||||||
multi-line edit is clipped due to being out of view.
|
multi-line edit is clipped due to being out of view.
|
||||||
|
- Tables:
|
||||||
|
- Fixed an issue reporting ideal size to parent window/container when both scrollbars
|
||||||
|
are visible but only one of ScrollX/ScrollY was explicitly requested. (#9352, #7651)
|
||||||
- Fonts:
|
- Fonts:
|
||||||
- imgui_freetype: add FreeType headers & compiled version in 'About Dear ImGui' details.
|
- imgui_freetype: add FreeType headers & compiled version in 'About Dear ImGui' details.
|
||||||
- Clipper:
|
- Clipper:
|
||||||
|
|||||||
+4
-5
@@ -1565,11 +1565,10 @@ void ImGui::EndTable()
|
|||||||
}
|
}
|
||||||
else if (temp_data->UserOuterSize.x <= 0.0f)
|
else if (temp_data->UserOuterSize.x <= 0.0f)
|
||||||
{
|
{
|
||||||
// Some references for this: #7651 + tests "table_reported_size", "table_reported_size_outer" equivalent Y block
|
// Some references for this: #7651 + tests "table_reported_size", "table_reported_size_outer" equivalent Y block, #9352
|
||||||
// - Checking for ImGuiTableFlags_ScrollX/ScrollY flag makes us a frame ahead when disabling those flags.
|
// - FIXME-TABLE: Would make sense to pre-compute expected scrollbar visibility/sizes to generally save a frame of feedback?
|
||||||
// - FIXME-TABLE: Would make sense to pre-compute expected scrollbar visibility/sizes to generally save a frame of feedback.
|
|
||||||
const float inner_content_max_x = table->OuterRect.Min.x + table->ColumnsAutoFitWidth; // Slightly misleading name but used for code symmetry with inner_content_max_y
|
const float inner_content_max_x = table->OuterRect.Min.x + table->ColumnsAutoFitWidth; // Slightly misleading name but used for code symmetry with inner_content_max_y
|
||||||
const float decoration_size = table->TempData->AngledHeadersExtraWidth + ((table->Flags & ImGuiTableFlags_ScrollY) ? inner_window->ScrollbarSizes.x : 0.0f);
|
const float decoration_size = table->TempData->AngledHeadersExtraWidth + ((inner_window != outer_window) ? inner_window->ScrollbarSizes.x : 0.0f);
|
||||||
outer_window->DC.IdealMaxPos.x = ImMax(outer_window->DC.IdealMaxPos.x, inner_content_max_x + decoration_size - temp_data->UserOuterSize.x);
|
outer_window->DC.IdealMaxPos.x = ImMax(outer_window->DC.IdealMaxPos.x, inner_content_max_x + decoration_size - temp_data->UserOuterSize.x);
|
||||||
outer_window->DC.CursorMaxPos.x = ImMax(backup_outer_max_pos.x, ImMin(table->OuterRect.Max.x, inner_content_max_x + decoration_size));
|
outer_window->DC.CursorMaxPos.x = ImMax(backup_outer_max_pos.x, ImMin(table->OuterRect.Max.x, inner_content_max_x + decoration_size));
|
||||||
}
|
}
|
||||||
@@ -1579,7 +1578,7 @@ void ImGui::EndTable()
|
|||||||
}
|
}
|
||||||
if (temp_data->UserOuterSize.y <= 0.0f)
|
if (temp_data->UserOuterSize.y <= 0.0f)
|
||||||
{
|
{
|
||||||
const float decoration_size = (table->Flags & ImGuiTableFlags_ScrollX) ? inner_window->ScrollbarSizes.y : 0.0f;
|
const float decoration_size = (inner_window != outer_window ? inner_window->ScrollbarSizes.y : 0.0f);
|
||||||
outer_window->DC.IdealMaxPos.y = ImMax(outer_window->DC.IdealMaxPos.y, inner_content_max_y + decoration_size - temp_data->UserOuterSize.y);
|
outer_window->DC.IdealMaxPos.y = ImMax(outer_window->DC.IdealMaxPos.y, inner_content_max_y + decoration_size - temp_data->UserOuterSize.y);
|
||||||
outer_window->DC.CursorMaxPos.y = ImMax(backup_outer_max_pos.y, ImMin(table->OuterRect.Max.y, inner_content_max_y + decoration_size));
|
outer_window->DC.CursorMaxPos.y = ImMax(backup_outer_max_pos.y, ImMin(table->OuterRect.Max.y, inner_content_max_y + decoration_size));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user