@@ -6838,16 +6838,18 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
68386838 window->InnerRect.Max.y = window->Pos.y + window->Size.y - window->DecoOuterSizeY2;
68396839
68406840 // Inner clipping rectangle.
6841- // Will extend a little bit outside the normal work region.
6842- // This is to allow e.g. Selectable or CollapsingHeader or some separators to cover that space.
6843- // Force round operator last to ensure that e.g. (int)(max.x-min.x) in user's render code produce correct result.
6841+ // - Extend a outside of normal work region up to borders.
6842+ // - This is to allow e.g. Selectable or CollapsingHeader or some separators to cover that space.
6843+ // - It also makes clipped items be more noticeable.
6844+ // - And is consistent on both axis (prior to 2024/05/03 ClipRect used WindowPadding.x * 0.5f on left and right edge), see #3312
6845+ // - Force round operator last to ensure that e.g. (int)(max.x-min.x) in user's render code produce correct result.
68446846 // Note that if our window is collapsed we will end up with an inverted (~null) clipping rectangle which is the correct behavior.
68456847 // Affected by window/frame border size. Used by:
68466848 // - Begin() initial clip rect
68476849 float top_border_size = (((flags & ImGuiWindowFlags_MenuBar) || !(flags & ImGuiWindowFlags_NoTitleBar)) ? style.FrameBorderSize : window->WindowBorderSize);
6848- window->InnerClipRect.Min.x = ImFloor(0.5f + window->InnerRect.Min.x + ImMax(ImTrunc( window->WindowPadding.x * 0.5f), window-> WindowBorderSize) );
6850+ window->InnerClipRect.Min.x = ImFloor(0.5f + window->InnerRect.Min.x + window->WindowBorderSize);
68496851 window->InnerClipRect.Min.y = ImFloor(0.5f + window->InnerRect.Min.y + top_border_size);
6850- window->InnerClipRect.Max.x = ImFloor(0.5f + window->InnerRect.Max.x - ImMax(ImTrunc( window->WindowPadding.x * 0.5f), window-> WindowBorderSize) );
6852+ window->InnerClipRect.Max.x = ImFloor(0.5f + window->InnerRect.Max.x - window->WindowBorderSize);
68516853 window->InnerClipRect.Max.y = ImFloor(0.5f + window->InnerRect.Max.y - window->WindowBorderSize);
68526854 window->InnerClipRect.ClipWithFull(host_rect);
68536855
0 commit comments