Added GetMouseDragDelta() helper. No unlock threshold yet (#167)

This commit is contained in:
ocornut
2015-03-20 10:49:17 +00:00
parent a71fc8e6a5
commit 2d29907611
2 changed files with 9 additions and 0 deletions

View File

@ -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();