@ -698,7 +698,7 @@ static void SaveIniSettingsToDisk(const char* ini_filename);
static void SaveIniSettingsToMemory ( ImVector < char > & out_buf ) ;
static void MarkIniSettingsDirty ( ImGuiWindow * window ) ;
static ImRect GetVisibl eRect ( ) ;
static ImRect GetViewport Rect ( ) ;
static void CloseInactivePopups ( ImGuiWindow * ref_window ) ;
static void ClosePopupToLevel ( int remaining ) ;
@ -2629,7 +2629,7 @@ static ImVec2 NavCalcPreferredMousePos()
return g . IO . MousePos ;
const ImRect & rect_rel = window - > NavRectRel [ g . NavLayer ] ;
ImVec2 pos = g . NavWindow - > Pos + ImVec2 ( rect_rel . Min . x + ImMin ( g . Style . FramePadding . x * 4 , rect_rel . GetWidth ( ) ) , rect_rel . Max . y - ImMin ( g . Style . FramePadding . y , rect_rel . GetHeight ( ) ) ) ;
ImRect visible_rect = GetVisibl eRect ( ) ;
ImRect visible_rect = GetViewport Rect ( ) ;
return ImFloor ( ImClamp ( pos , visible_rect . Min , visible_rect . Max ) ) ; // ImFloor() is important because non-integer mouse position application in backend might be lossy and result in undesirable non-zero delta.
}
@ -4592,7 +4592,7 @@ ImVec2 ImGui::GetItemRectSize()
return window - > DC . LastItemRect . GetSize ( ) ;
}
static ImRect GetVisibl eRect ( )
static ImRect GetViewport Rect ( )
{
ImGuiContext & g = * GImGui ;
if ( g . IO . DisplayVisibleMin . x ! = g . IO . DisplayVisibleMax . x & & g . IO . DisplayVisibleMin . y ! = g . IO . DisplayVisibleMax . y )
@ -5046,7 +5046,7 @@ static ImVec2 FindBestWindowPosForPopup(const ImVec2& ref_pos, const ImVec2& siz
// r_avoid = the rectangle to avoid (e.g. for tooltip it is a rectangle around the mouse cursor which we want to avoid. for popups it's a small point around the cursor.)
// r_outer = the visible area rectangle, minus safe area padding. If our popup size won't fit because of safe area padding we ignore it.
ImVec2 safe_padding = style . DisplaySafeAreaPadding ;
ImRect r_outer ( GetVisibl eRect ( ) ) ;
ImRect r_outer ( GetViewport Rect ( ) ) ;
r_outer . Expand ( ImVec2 ( ( size . x - r_outer . GetWidth ( ) > safe_padding . x * 2 ) ? - safe_padding . x : 0.0f , ( size . y - r_outer . GetHeight ( ) > safe_padding . y * 2 ) ? - safe_padding . y : 0.0f ) ) ;
ImVec2 base_pos_clamped = ImClamp ( ref_pos , r_outer . Min , r_outer . Max - size ) ;
//GImGui->OverlayDrawList.AddRect(r_avoid.Min, r_avoid.Max, IM_COL32(255,0,0,255));
@ -5750,15 +5750,15 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window - > DrawList - > Clear ( ) ;
window - > DrawList - > Flags = ( g . Style . AntiAliasedLines ? ImDrawListFlags_AntiAliasedLines : 0 ) | ( g . Style . AntiAliasedFill ? ImDrawListFlags_AntiAliasedFill : 0 ) ;
window - > DrawList - > PushTextureID ( g . Font - > ContainerAtlas - > TexID ) ;
ImRect fullscreen _rect( GetVisibl eRect ( ) ) ;
ImRect viewport _rect( GetViewport Rect ( ) ) ;
if ( ( flags & ImGuiWindowFlags_ChildWindow ) & & ! ( flags & ImGuiWindowFlags_Popup ) & & ! window_is_child_tooltip )
PushClipRect ( parent_window - > ClipRect . Min , parent_window - > ClipRect . Max , true ) ;
else
PushClipRect ( fullscreen _rect. Min , fullscreen _rect. Max , true ) ;
PushClipRect ( viewport _rect. Min , viewport _rect. Max , true ) ;
// Draw modal window background (darkens what is behind them)
if ( ( flags & ImGuiWindowFlags_Modal ) ! = 0 & & window = = GetFrontMostModalRootWindow ( ) )
window - > DrawList - > AddRectFilled ( fullscreen _rect. Min , fullscreen _rect. Max , GetColorU32 ( ImGuiCol_ModalWindowDarkening , g . ModalWindowDarkeningRatio ) ) ;
window - > DrawList - > AddRectFilled ( viewport _rect. Min , viewport _rect. Max , GetColorU32 ( ImGuiCol_ModalWindowDarkening , g . ModalWindowDarkeningRatio ) ) ;
// Draw navigation selection/windowing rectangle background
if ( g . NavWindowingTarget = = window )