Added GetMouseDragDelta() helper. No unlock threshold yet (#167)
This commit is contained in:
parent
a71fc8e6a5
commit
2d29907611
@ -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();
|
||||
|
1
imgui.h
1
imgui.h
@ -371,6 +371,7 @@ namespace ImGui
|
||||
IMGUI_API bool IsMouseHoveringRect(const ImVec2& rect_min, const ImVec2& rect_max);// is mouse hovering given bounding rect
|
||||
IMGUI_API bool IsPosHoveringAnyWindow(const ImVec2& pos); // is given position hovering any active imgui window
|
||||
IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
|
||||
IMGUI_API ImVec2 GetMouseDragDelta(); // dragging amount - also see: GetItemActiveDragDelta().
|
||||
IMGUI_API float GetTime();
|
||||
IMGUI_API int GetFrameCount();
|
||||
IMGUI_API const char* GetStyleColName(ImGuiCol idx);
|
||||
|
Loading…
Reference in New Issue
Block a user