GetMouseDragDelta(): also returns the delta on the mouse button released frame. Verify that mouse positions are valid otherwise returns zero. Removed obsolete comment. Tweaked demo. (#2419)
// Return the delta from the initial clicking position.
// Return the delta from the initial clicking position while the mouse button is clicked or was just released.
// This is locked and return 0.0f until the mouse moves past a distance threshold at least once.
// NB: This is only valid if IsMousePosValid(). Back-ends in theory should always keep mouse position valid when dragging even outside the client window.
IMGUI_APIboolIsMousePosValid(constImVec2*mouse_pos=NULL);// by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse
IMGUI_APIImVec2GetMousePos();// shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
IMGUI_APIImVec2GetMousePosOnOpeningCurrentPopup();// retrieve backup of mouse position at the time of opening popup we have BeginPopup() into
IMGUI_APIImVec2GetMouseDragDelta(intbutton=0,floatlock_threshold=-1.0f);// return the delta from the initial clicking position. This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lock_threshold < -1.0f uses io.MouseDraggingThreshold
IMGUI_APIImVec2GetMouseDragDelta(intbutton=0,floatlock_threshold=-1.0f);// return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once. If lock_threshold < -1.0f uses io.MouseDraggingThreshold.
IMGUI_APIvoidResetMouseDragDelta(intbutton=0);//
IMGUI_APIImGuiMouseCursorGetMouseCursor();// get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
IMGUI_APIvoidSetMouseCursor(ImGuiMouseCursortype);// set desired cursor type
ImGui::GetForegroundDrawList()->AddLine(io.MouseClickedPos[0],io.MousePos,ImGui::GetColorU32(ImGuiCol_Button),4.0f);// Draw a line between the button and the mouse cursor
// Drag operations gets "unlocked" when the mouse has moved past a certain threshold (the default threshold is stored in io.MouseDragThreshold)
// You can request a lower or higher threshold using the second parameter of IsMouseDragging() and GetMouseDragDelta()