Skip to content

Commit 25f3717

Browse files
committed
Removed IsPosHoveringAnyWindow() which was severaly broken and misleading (most people want to use io.WantCaptureMouse). Added dummy function with assert for now. (#1237)
1 parent d1145e9 commit 25f3717

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

imgui.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code.
153153
Also read releases logs https://github.com/ocornut/imgui/releases for more details.
154154
155+
- 2017/07/20 (1.51) - Removed IsPosHoveringAnyWindow(ImVec2), which was partly broken and misleading. ASSERT + redirect user to io.WantCaptureMouse
155156
- 2017/05/26 (1.50) - Removed ImFontConfig::MergeGlyphCenterV in favor of a more multipurpose ImFontConfig::GlyphOffset.
156157
- 2017/05/01 (1.50) - Renamed ImDrawList::PathFill() (rarely used directly) to ImDrawList::PathFillConvex() for clarity.
157158
- 2016/11/06 (1.50) - BeginChild(const char*) now applies the stack id to the provided label, consistently with other functions as it should always have been. It shouldn't affect you unless (extremely unlikely) you were appending multiple times to a same child from different locations of the stack id. If that's the case, generate an id with GetId() and use it instead of passing string to BeginChild().
@@ -3146,11 +3147,6 @@ bool ImGui::IsMouseHoveringAnyWindow()
31463147
return g.HoveredWindow != NULL;
31473148
}
31483149

3149-
bool ImGui::IsPosHoveringAnyWindow(const ImVec2& pos)
3150-
{
3151-
return FindHoveredWindow(pos, false) != NULL;
3152-
}
3153-
31543150
static bool IsKeyPressedMap(ImGuiKey key, bool repeat)
31553151
{
31563152
const int key_index = GImGui->IO.KeyMap[key];

imgui.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ namespace ImGui
417417
IMGUI_API bool IsRootWindowOrAnyChildHovered(); // is current root window or any of its child (including current window) hovered and hoverable (not blocked by a popup)
418418
IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle (of given size, starting from cursor position) is visible / not clipped.
419419
IMGUI_API bool IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max); // test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side.
420-
IMGUI_API bool IsPosHoveringAnyWindow(const ImVec2& pos); // is given position hovering any active imgui window
421420
IMGUI_API float GetTime();
422421
IMGUI_API int GetFrameCount();
423422
IMGUI_API const char* GetStyleColName(ImGuiCol idx);
@@ -471,6 +470,7 @@ namespace ImGui
471470

472471
// Obsolete functions (Will be removed! Also see 'API BREAKING CHANGES' section in imgui.cpp)
473472
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
473+
static inline bool IsPosHoveringAnyWindow(const ImVec2&) { IM_ASSERT(0); return false; } // OBSOLETE 1.51+. This was partly broken. You probably wanted to use ImGui::GetIO().WantCaptureMouse instead.
474474
static inline bool CollapsingHeader(const char* label, const char* str_id, bool framed = true, bool default_open = false) { (void)str_id; (void)framed; ImGuiTreeNodeFlags default_open_flags = 1<<5; return CollapsingHeader(label, (default_open ? default_open_flags : 0)); } // OBSOLETE 1.49+
475475
static inline ImFont* GetWindowFont() { return GetFont(); } // OBSOLETE 1.48+
476476
static inline float GetWindowFontSize() { return GetFontSize(); } // OBSOLETE 1.48+

0 commit comments

Comments
 (0)