mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Added ImGui::GetItemActiveDragDelta() helpers for drag operations
This commit is contained in:
11
imgui.cpp
11
imgui.cpp
@ -2551,6 +2551,17 @@ bool ImGui::IsAnyItemActive()
|
||||
return g.ActiveId != 0;
|
||||
}
|
||||
|
||||
ImVec2 ImGui::GetItemActiveDragDelta()
|
||||
{
|
||||
if (ImGui::IsItemActive())
|
||||
{
|
||||
ImGuiState& g = *GImGui;
|
||||
if (g.IO.MouseDown[0])
|
||||
return g.IO.MousePos - g.IO.MouseClickedPos[0]; // Assume we can only get active with left-mouse button (at the moment).
|
||||
}
|
||||
return ImVec2(0.0f, 0.0f);
|
||||
}
|
||||
|
||||
ImVec2 ImGui::GetItemRectMin()
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
|
Reference in New Issue
Block a user