mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 13:08:47 +02:00
Added GetMouseDragDelta() helper. No unlock threshold yet (#167)
This commit is contained in:
@ -2541,6 +2541,14 @@ ImVec2 ImGui::GetMousePos()
|
||||
return GImGui->IO.MousePos;
|
||||
}
|
||||
|
||||
ImVec2 ImGui::GetMouseDragDelta()
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
bool ImGui::IsItemHovered()
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
|
Reference in New Issue
Block a user