diff --git a/src/immvision/internal/image.cpp b/src/immvision/internal/image.cpp index 7b02404..6e17ac1 100644 --- a/src/immvision/internal/image.cpp +++ b/src/immvision/internal/image.cpp @@ -497,11 +497,21 @@ namespace ImmVision ImVec2 tl(br.x - size, br.y - size); ImRect zone(tl, br); - ImGui::GetWindowDrawList()->AddTriangleFilled(br, bl, tr, ImGui::GetColorU32(ImGuiCol_ButtonHovered)); + + { + auto cursorPos = ImGui::GetCursorPos(); + ImGui::SetCursorPos(tl); + ImGui::InvisibleButton("##resize", zone.GetSize()); + ImGui::SetCursorPos(cursorPos); + } + + bool isMouseHoveringWidget = ImGui::IsMouseHoveringRect(zone.Min, zone.Max); + ImU32 color = isMouseHoveringWidget ? ImGui::GetColorU32(ImGuiCol_ButtonHovered) : ImGui::GetColorU32(ImGuiCol_Button); + ImGui::GetWindowDrawList()->AddTriangleFilled(br, bl, tr, color); if (!cacheParams.IsResizing) { - if (ImGui::IsMouseHoveringRect(zone.Min, zone.Max) && ImGui::IsMouseDown(0)) + if (isMouseHoveringWidget && ImGui::IsMouseDown(0)) { ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNWSE); cacheParams.IsResizing = true; diff --git a/src_all_in_one/immvision/immvision.cpp b/src_all_in_one/immvision/immvision.cpp index 2206975..b4320b0 100644 --- a/src_all_in_one/immvision/immvision.cpp +++ b/src_all_in_one/immvision/immvision.cpp @@ -9955,11 +9955,21 @@ namespace ImmVision ImVec2 tl(br.x - size, br.y - size); ImRect zone(tl, br); - ImGui::GetWindowDrawList()->AddTriangleFilled(br, bl, tr, ImGui::GetColorU32(ImGuiCol_ButtonHovered)); + + { + auto cursorPos = ImGui::GetCursorPos(); + ImGui::SetCursorPos(tl); + ImGui::InvisibleButton("##resize", zone.GetSize()); + ImGui::SetCursorPos(cursorPos); + } + + bool isMouseHoveringWidget = ImGui::IsMouseHoveringRect(zone.Min, zone.Max); + ImU32 color = isMouseHoveringWidget ? ImGui::GetColorU32(ImGuiCol_ButtonHovered) : ImGui::GetColorU32(ImGuiCol_Button); + ImGui::GetWindowDrawList()->AddTriangleFilled(br, bl, tr, color); if (!cacheParams.IsResizing) { - if (ImGui::IsMouseHoveringRect(zone.Min, zone.Max) && ImGui::IsMouseDown(0)) + if (isMouseHoveringWidget && ImGui::IsMouseDown(0)) { ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNWSE); cacheParams.IsResizing = true;