mirror of
https://github.com/ocornut/imgui.git
synced 2025-09-13 06:48:24 +00:00
CollapsingHeader: left-side outer extend matches right-side one (moved left by one pixel)
Amend c3a348aa2
This commit is contained in:
@@ -6396,10 +6396,9 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiID storage_id, ImGuiTreeNodeFlags
|
|||||||
frame_bb.Max.y = window->DC.CursorPos.y + frame_height;
|
frame_bb.Max.y = window->DC.CursorPos.y + frame_height;
|
||||||
if (display_frame)
|
if (display_frame)
|
||||||
{
|
{
|
||||||
// Framed header expand a little outside the default padding, to the edge of InnerClipRect
|
const float outer_extend = IM_TRUNC(window->WindowPadding.x * 0.5f); // Framed header expand a little outside of current limits
|
||||||
// (FIXME: May remove this at some point and make InnerClipRect align with WindowPadding.x instead of WindowPadding.x*0.5f)
|
frame_bb.Min.x -= outer_extend;
|
||||||
frame_bb.Min.x -= IM_TRUNC(window->WindowPadding.x * 0.5f - 1.0f);
|
frame_bb.Max.x += outer_extend;
|
||||||
frame_bb.Max.x += IM_TRUNC(window->WindowPadding.x * 0.5f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImVec2 text_pos(window->DC.CursorPos.x + text_offset_x, window->DC.CursorPos.y + text_offset_y);
|
ImVec2 text_pos(window->DC.CursorPos.x + text_offset_x, window->DC.CursorPos.y + text_offset_y);
|
||||||
@@ -6783,7 +6782,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
|
|||||||
const ImVec2 text_max(min_x + size.x, pos.y + size.y);
|
const ImVec2 text_max(min_x + size.x, pos.y + size.y);
|
||||||
|
|
||||||
// Selectables are meant to be tightly packed together with no click-gap, so we extend their box to cover spacing between selectable.
|
// Selectables are meant to be tightly packed together with no click-gap, so we extend their box to cover spacing between selectable.
|
||||||
// FIXME: Not part of layout so not included in clipper calculation, but ItemSize currenty doesn't allow offsetting CursorPos.
|
// FIXME: Not part of layout so not included in clipper calculation, but ItemSize currently doesn't allow offsetting CursorPos.
|
||||||
ImRect bb(min_x, pos.y, text_max.x, text_max.y);
|
ImRect bb(min_x, pos.y, text_max.x, text_max.y);
|
||||||
if ((flags & ImGuiSelectableFlags_NoPadWithHalfSpacing) == 0)
|
if ((flags & ImGuiSelectableFlags_NoPadWithHalfSpacing) == 0)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user