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