@ -5729,6 +5729,11 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
const float grip_hover_inner_size = IM_FLOOR ( grip_draw_size * 0.75f ) ;
const float grip_hover_inner_size = IM_FLOOR ( grip_draw_size * 0.75f ) ;
const float grip_hover_outer_size = g . IO . ConfigWindowsResizeFromEdges ? WINDOWS_HOVER_PADDING : 0.0f ;
const float grip_hover_outer_size = g . IO . ConfigWindowsResizeFromEdges ? WINDOWS_HOVER_PADDING : 0.0f ;
ImRect clamp_rect = visibility_rect ;
const bool window_move_from_title_bar = g . IO . ConfigWindowsMoveFromTitleBarOnly & & ! ( window - > Flags & ImGuiWindowFlags_NoTitleBar ) ;
if ( window_move_from_title_bar )
clamp_rect . Min . y - = window - > TitleBarHeight ( ) ;
ImVec2 pos_target ( FLT_MAX , FLT_MAX ) ;
ImVec2 pos_target ( FLT_MAX , FLT_MAX ) ;
ImVec2 size_target ( FLT_MAX , FLT_MAX ) ;
ImVec2 size_target ( FLT_MAX , FLT_MAX ) ;
@ -5765,8 +5770,8 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
{
{
// Resize from any of the four corners
// Resize from any of the four corners
// We don't use an incremental MouseDelta but rather compute an absolute target size based on mouse position
// We don't use an incremental MouseDelta but rather compute an absolute target size based on mouse position
ImVec2 clamp_min = ImVec2 ( def . CornerPosN . x = = 1.0f ? visibility _rect. Min . x : - FLT_MAX , def . CornerPosN . y = = 1.0f ? visibility _rect. Min . y : - FLT_MAX ) ;
ImVec2 clamp_min = ImVec2 ( def . CornerPosN . x = = 1.0f ? clamp _rect. Min . x : - FLT_MAX , ( def . CornerPosN . y = = 1.0f | | ( def . CornerPosN . y = = 0.0f & & window_move_from_title_bar ) ) ? clamp _rect. Min . y : - FLT_MAX ) ;
ImVec2 clamp_max = ImVec2 ( def . CornerPosN . x = = 0.0f ? visibility _rect. Max . x : + FLT_MAX , def . CornerPosN . y = = 0.0f ? visibility _rect. Max . y : + FLT_MAX ) ;
ImVec2 clamp_max = ImVec2 ( def . CornerPosN . x = = 0.0f ? clamp _rect. Max . x : + FLT_MAX , def . CornerPosN . y = = 0.0f ? clamp _rect. Max . y : + FLT_MAX ) ;
ImVec2 corner_target = g . IO . MousePos - g . ActiveIdClickOffset + ImLerp ( def . InnerDir * grip_hover_outer_size , def . InnerDir * - grip_hover_inner_size , def . CornerPosN ) ; // Corner of the window corresponding to our corner grip
ImVec2 corner_target = g . IO . MousePos - g . ActiveIdClickOffset + ImLerp ( def . InnerDir * grip_hover_outer_size , def . InnerDir * - grip_hover_inner_size , def . CornerPosN ) ; // Corner of the window corresponding to our corner grip
corner_target = ImClamp ( corner_target , clamp_min , clamp_max ) ;
corner_target = ImClamp ( corner_target , clamp_min , clamp_max ) ;
CalcResizePosSizeFromAnyCorner ( window , corner_target , def . CornerPosN , & pos_target , & size_target ) ;
CalcResizePosSizeFromAnyCorner ( window , corner_target , def . CornerPosN , & pos_target , & size_target ) ;
@ -5795,8 +5800,8 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
}
}
if ( held )
if ( held )
{
{
ImVec2 clamp_min ( border_n = = ImGuiDir_Right ? visibility _rect. Min . x : - FLT_MAX , border_n = = ImGuiDir_Down ? visibility _rect. Min . y : - FLT_MAX ) ;
ImVec2 clamp_min ( border_n = = ImGuiDir_Right ? clamp _rect. Min . x : - FLT_MAX , border_n = = ImGuiDir_Down | | ( border_n = = ImGuiDir_Up & & window_move_from_title_bar ) ? clamp _rect. Min . y : - FLT_MAX ) ;
ImVec2 clamp_max ( border_n = = ImGuiDir_Left ? visibility _rect . Max . x : + FLT_MAX , border_n = = ImGuiDir_Up ? visibility _rect . Max . y : + FLT_MAX ) ;
ImVec2 clamp_max ( border_n = = ImGuiDir_Left ? clamp _rect. Max . x : + FLT_MAX , border_n = = ImGuiDir_Up ? clamp _rect. Max . y : + FLT_MAX ) ;
ImVec2 border_target = window - > Pos ;
ImVec2 border_target = window - > Pos ;
border_target [ axis ] = g . IO . MousePos [ axis ] - g . ActiveIdClickOffset [ axis ] + WINDOWS_HOVER_PADDING ;
border_target [ axis ] = g . IO . MousePos [ axis ] - g . ActiveIdClickOffset [ axis ] + WINDOWS_HOVER_PADDING ;
border_target = ImClamp ( border_target , clamp_min , clamp_max ) ;
border_target = ImClamp ( border_target , clamp_min , clamp_max ) ;
@ -5823,7 +5828,7 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
const float NAV_RESIZE_SPEED = 600.0f ;
const float NAV_RESIZE_SPEED = 600.0f ;
const float resize_step = NAV_RESIZE_SPEED * g . IO . DeltaTime * ImMin ( g . IO . DisplayFramebufferScale . x , g . IO . DisplayFramebufferScale . y ) ;
const float resize_step = NAV_RESIZE_SPEED * g . IO . DeltaTime * ImMin ( g . IO . DisplayFramebufferScale . x , g . IO . DisplayFramebufferScale . y ) ;
g . NavWindowingAccumDeltaSize + = nav_resize_dir * resize_step ;
g . NavWindowingAccumDeltaSize + = nav_resize_dir * resize_step ;
g . NavWindowingAccumDeltaSize = ImMax ( g . NavWindowingAccumDeltaSize , visibility _rect. Min - window - > Pos - window - > Size ) ; // We need Pos+Size >= visibility_rect.Min, so Size >= visibility_rect.Min - Pos, so size_delta >= visibility _rect.Min - window->Pos - window->Size
g . NavWindowingAccumDeltaSize = ImMax ( g . NavWindowingAccumDeltaSize , clamp _rect. Min - window - > Pos - window - > Size ) ; // We need Pos+Size >= clmap_rect.Min, so Size >= clmap_rect.Min - Pos, so size_delta >= clmap _rect.Min - window->Pos - window->Size
g . NavWindowingToggleLayer = false ;
g . NavWindowingToggleLayer = false ;
g . NavDisableMouseHover = true ;
g . NavDisableMouseHover = true ;
resize_grip_col [ 0 ] = GetColorU32 ( ImGuiCol_ResizeGripActive ) ;
resize_grip_col [ 0 ] = GetColorU32 ( ImGuiCol_ResizeGripActive ) ;