mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-23 12:27:01 +00:00
Renamed IsItemHoveredRectOnly -> IsItemHoveredRect (introduced after previous release)
This commit is contained in:
parent
8b7668d24f
commit
743c815821
14
imgui.cpp
14
imgui.cpp
@ -982,7 +982,7 @@ struct ImGuiDrawContext
|
|||||||
ImGuiID LastItemID;
|
ImGuiID LastItemID;
|
||||||
ImRect LastItemRect;
|
ImRect LastItemRect;
|
||||||
bool LastItemHoveredAndUsable;
|
bool LastItemHoveredAndUsable;
|
||||||
bool LastItemHoveredRectOnly;
|
bool LastItemHoveredRect;
|
||||||
ImVector<ImGuiWindow*> ChildWindows;
|
ImVector<ImGuiWindow*> ChildWindows;
|
||||||
ImVector<bool> AllowKeyboardFocus;
|
ImVector<bool> AllowKeyboardFocus;
|
||||||
ImVector<float> ItemWidth; // 0.0: default, >0.0: width in pixels, <0.0: align xx pixels to the right of window
|
ImVector<float> ItemWidth; // 0.0: default, >0.0: width in pixels, <0.0: align xx pixels to the right of window
|
||||||
@ -1011,7 +1011,7 @@ struct ImGuiDrawContext
|
|||||||
TreeDepth = 0;
|
TreeDepth = 0;
|
||||||
LastItemID = 0;
|
LastItemID = 0;
|
||||||
LastItemRect = ImRect(0.0f,0.0f,0.0f,0.0f);
|
LastItemRect = ImRect(0.0f,0.0f,0.0f,0.0f);
|
||||||
LastItemHoveredAndUsable = LastItemHoveredRectOnly = false;
|
LastItemHoveredAndUsable = LastItemHoveredRect = false;
|
||||||
StateStorage = NULL;
|
StateStorage = NULL;
|
||||||
|
|
||||||
ColumnsStartX = 0.0f;
|
ColumnsStartX = 0.0f;
|
||||||
@ -2640,10 +2640,10 @@ bool ImGui::IsItemHovered()
|
|||||||
return window->DC.LastItemHoveredAndUsable;
|
return window->DC.LastItemHoveredAndUsable;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui::IsItemHoveredRectOnly()
|
bool ImGui::IsItemHoveredRect()
|
||||||
{
|
{
|
||||||
ImGuiWindow* window = GetCurrentWindow();
|
ImGuiWindow* window = GetCurrentWindow();
|
||||||
return window->DC.LastItemHoveredRectOnly;
|
return window->DC.LastItemHoveredRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ImGui::IsItemActive()
|
bool ImGui::IsItemActive()
|
||||||
@ -6956,7 +6956,7 @@ static bool ItemAdd(const ImRect& bb, const ImGuiID* id)
|
|||||||
window->DC.LastItemRect = bb;
|
window->DC.LastItemRect = bb;
|
||||||
if (IsClipped(bb))
|
if (IsClipped(bb))
|
||||||
{
|
{
|
||||||
window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRectOnly = false;
|
window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6966,7 +6966,7 @@ static bool ItemAdd(const ImRect& bb, const ImGuiID* id)
|
|||||||
{
|
{
|
||||||
// Matching the behavior of IsHovered() but ignore if ActiveId==window->MoveID (we clicked on the window background)
|
// Matching the behavior of IsHovered() but ignore if ActiveId==window->MoveID (we clicked on the window background)
|
||||||
// So that clicking on items with no active id such as Text() still returns true with IsItemHovered()
|
// So that clicking on items with no active id such as Text() still returns true with IsItemHovered()
|
||||||
window->DC.LastItemHoveredRectOnly = true;
|
window->DC.LastItemHoveredRect = true;
|
||||||
if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdIsFocusedOnly || (g.ActiveId == window->MoveID))
|
if (g.ActiveId == 0 || (id && g.ActiveId == *id) || g.ActiveIdIsFocusedOnly || (g.ActiveId == window->MoveID))
|
||||||
window->DC.LastItemHoveredAndUsable = true;
|
window->DC.LastItemHoveredAndUsable = true;
|
||||||
else
|
else
|
||||||
@ -6974,7 +6974,7 @@ static bool ItemAdd(const ImRect& bb, const ImGuiID* id)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRectOnly = false;
|
window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
4
imgui.h
4
imgui.h
@ -354,7 +354,7 @@ namespace ImGui
|
|||||||
|
|
||||||
// Utilities
|
// Utilities
|
||||||
IMGUI_API bool IsItemHovered(); // was the last item hovered by mouse?
|
IMGUI_API bool IsItemHovered(); // was the last item hovered by mouse?
|
||||||
IMGUI_API bool IsItemHoveredRectOnly(); // was the last item hovered by mouse? even if another item is active while we are hovering this
|
IMGUI_API bool IsItemHoveredRect(); // was the last item hovered by mouse? even if another item is active while we are hovering this
|
||||||
IMGUI_API bool IsItemActive(); // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
|
IMGUI_API bool IsItemActive(); // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
|
||||||
IMGUI_API bool IsAnyItemActive(); //
|
IMGUI_API bool IsAnyItemActive(); //
|
||||||
IMGUI_API ImVec2 GetItemRectMin(); // get bounding rect of last item
|
IMGUI_API ImVec2 GetItemRectMin(); // get bounding rect of last item
|
||||||
@ -373,7 +373,7 @@ namespace ImGui
|
|||||||
IMGUI_API bool IsMouseDragging(int button = 0, float lock_threshold = -1.0f); // is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
|
IMGUI_API bool IsMouseDragging(int button = 0, float lock_threshold = -1.0f); // is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
|
||||||
IMGUI_API bool IsPosHoveringAnyWindow(const ImVec2& pos); // is given position hovering any active imgui window
|
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 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
|
||||||
IMGUI_API ImVec2 GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f); // dragging amount, also see: GetItemActiveDragDelta(). if lock_threshold < -1.0f uses io.MouseDraggingThreshold
|
IMGUI_API ImVec2 GetMouseDragDelta(int button = 0, float lock_threshold = -1.0f); // dragging amount since clicking, also see: GetItemActiveDragDelta(). if lock_threshold < -1.0f uses io.MouseDraggingThreshold
|
||||||
IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
|
IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
|
||||||
IMGUI_API void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type
|
IMGUI_API void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type
|
||||||
IMGUI_API float GetTime();
|
IMGUI_API float GetTime();
|
||||||
|
Loading…
Reference in New Issue
Block a user