Settings: Fixed an issue marking settings as dirty when merely clicking on a border or resize grip without moving it.

This commit is contained in:
ocornut
2023-12-21 14:08:27 +01:00
parent 8340a30d27
commit f039e69b9c
2 changed files with 9 additions and 5 deletions

View File

@ -6050,15 +6050,17 @@ static int ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& si
}
// Apply back modified position/size to window
if (size_target.x != FLT_MAX)
const ImVec2 curr_pos = window->Pos;
const ImVec2 curr_size = window->SizeFull;
if (size_target.x != FLT_MAX && (window->Size.x != size_target.x || window->SizeFull.x != size_target.x))
window->Size.x = window->SizeFull.x = size_target.x;
if (size_target.y != FLT_MAX)
if (size_target.y != FLT_MAX && (window->Size.y != size_target.y || window->SizeFull.y != size_target.y))
window->Size.y = window->SizeFull.y = size_target.y;
if (pos_target.x != FLT_MAX)
if (pos_target.x != FLT_MAX && window->Pos.x != ImTrunc(pos_target.x))
window->Pos.x = ImTrunc(pos_target.x);
if (pos_target.y != FLT_MAX)
if (pos_target.y != FLT_MAX && window->Pos.y != ImTrunc(pos_target.y))
window->Pos.y = ImTrunc(pos_target.y);
if (size_target.x != FLT_MAX || size_target.y != FLT_MAX || pos_target.x != FLT_MAX || pos_target.y != FLT_MAX)
if (curr_pos.x != window->Pos.x || curr_pos.y != window->Pos.y || curr_size.x != window->SizeFull.x || curr_size.y != window->SizeFull.y)
MarkIniSettingsDirty(window);
// Recalculate next expected border expected coordinates