Renamed IsItemHoveredRectOnly -> IsItemHoveredRect (introduced after previous release)

This commit is contained in:
ocornut 2015-03-26 16:18:01 +00:00
parent 8b7668d24f
commit 743c815821
2 changed files with 9 additions and 9 deletions

View File

@ -982,7 +982,7 @@ struct ImGuiDrawContext
ImGuiID LastItemID;
ImRect LastItemRect;
bool LastItemHoveredAndUsable;
bool LastItemHoveredRectOnly;
bool LastItemHoveredRect;
ImVector<ImGuiWindow*> ChildWindows;
ImVector<bool> AllowKeyboardFocus;
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;
LastItemID = 0;
LastItemRect = ImRect(0.0f,0.0f,0.0f,0.0f);
LastItemHoveredAndUsable = LastItemHoveredRectOnly = false;
LastItemHoveredAndUsable = LastItemHoveredRect = false;
StateStorage = NULL;
ColumnsStartX = 0.0f;
@ -2640,10 +2640,10 @@ bool ImGui::IsItemHovered()
return window->DC.LastItemHoveredAndUsable;
}
bool ImGui::IsItemHoveredRectOnly()
bool ImGui::IsItemHoveredRect()
{
ImGuiWindow* window = GetCurrentWindow();
return window->DC.LastItemHoveredRectOnly;
return window->DC.LastItemHoveredRect;
}
bool ImGui::IsItemActive()
@ -6956,7 +6956,7 @@ static bool ItemAdd(const ImRect& bb, const ImGuiID* id)
window->DC.LastItemRect = bb;
if (IsClipped(bb))
{
window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRectOnly = false;
window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = 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)
// 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))
window->DC.LastItemHoveredAndUsable = true;
else
@ -6974,7 +6974,7 @@ static bool ItemAdd(const ImRect& bb, const ImGuiID* id)
}
else
{
window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRectOnly = false;
window->DC.LastItemHoveredAndUsable = window->DC.LastItemHoveredRect = false;
}
return true;

View File

@ -354,7 +354,7 @@ namespace ImGui
// Utilities
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 IsAnyItemActive(); //
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 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(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 void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type
IMGUI_API float GetTime();