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

@ -75,6 +75,8 @@ Other changes:
- ColorEdit4: Layout tweaks for very small sizes. (#7120, #7121)
- Menus: Tweaked hover slack logic, adding a timer to avoid situations where a slow vertical
movements toward another parent BeginMenu() can keep the wrong child menu open. (#6671, #6926)
- Settings: Fixed an issue marking settings as dirty when merely clicking on a border or resize
grip without moving it.
- Debug Tools: Added DebugFlashStyleColor() to identify a style color. Added to Style Editor.
- Debug Tools: Debug Log: Hide its own clipper log to reduce noise in the output.
- Misc: Added IMGUI_USER_H_FILENAME to change the path included when using

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