mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-29 14:56:36 +00:00
Made AlignFirstTextHeightToWidgets() saner and faster (still disliking its name very much!)
This commit is contained in:
parent
a8788e51a7
commit
a0d724b450
@ -5653,10 +5653,9 @@ void ImGui::AlignFirstTextHeightToWidgets()
|
|||||||
if (window->SkipItems)
|
if (window->SkipItems)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Declare a dummy item size to that upcoming items that are smaller will center-align on the newly expanded line height.
|
|
||||||
ImGuiContext& g = *GImGui;
|
ImGuiContext& g = *GImGui;
|
||||||
ItemSize(ImVec2(0, g.FontSize + g.Style.FramePadding.y*2), g.Style.FramePadding.y);
|
window->DC.CurrentLineHeight = ImMax(window->DC.CurrentLineHeight, g.FontSize + g.Style.FramePadding.y * 2);
|
||||||
SameLine(0, 0);
|
window->DC.CurrentLineTextBaseOffset = ImMax(window->DC.CurrentLineTextBaseOffset, g.Style.FramePadding.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a label+text combo aligned to other label+value widgets
|
// Add a label+text combo aligned to other label+value widgets
|
||||||
|
Loading…
Reference in New Issue
Block a user