From 743c81582122ca2bdef37b511529b8559a31d29b Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 26 Mar 2015 16:18:01 +0000 Subject: [PATCH] Renamed IsItemHoveredRectOnly -> IsItemHoveredRect (introduced after previous release) --- imgui.cpp | 14 +++++++------- imgui.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 144ce8954..f2668f7ec 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -982,7 +982,7 @@ struct ImGuiDrawContext ImGuiID LastItemID; ImRect LastItemRect; bool LastItemHoveredAndUsable; - bool LastItemHoveredRectOnly; + bool LastItemHoveredRect; ImVector ChildWindows; ImVector AllowKeyboardFocus; ImVector 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; diff --git a/imgui.h b/imgui.h index 0e09024f6..0a9cee54d 100644 --- a/imgui.h +++ b/imgui.h @@ -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();