You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying for a bit to get SetItemKeyOwner(ImGuiKey_MouseWheelY) working with PlotLines(). Calling this does not seem to do anything in the current version (both main and docking) - scrolling still falls through to the parent window.
I noticed that PlotEx in imgui_widgets.cpp reads the following at line 8230 (line number is for a recent docking version):
if (!ItemAdd(total_bb, 0, &frame_bb)) // etc...
Is this intentional? I am not super familiar with the codebase so forgive me for asking rather than submitting a pull request. Changing this to:
if (!ItemAdd(total_bb, id, &frame_bb)) // etc...
fixes my issue, but not having a firm understanding of how id's/items etc work I am wary of leaving it this way.
-a
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
// Here's some code anyone can copy and paste to reproduce your issuestaticfloat arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr));
ImGui::SetItemKeyOwner(ImGuiKey_MouseWheelY);
ImGui::SetItemKeyOwner(ImGuiKey_MouseWheelX);
// scrolling will still happen if possible in the parent window
The text was updated successfully, but these errors were encountered:
ocornut
changed the title
PlotLines() does not work with SetItemKeyOwner()
PlotLines() doesn't register its ID, does not work with SetItemKeyOwner()
Sep 3, 2024
This was initially done by c2cb2a6 i believe as a way to prevent keyboard/gamepad navigation to land on the item, and 97ed97b did things half-way but you are right we should pass id to ItemAdd() + add ImGuiItemFlags_NoNav, which is what I have done now in afb15e9.
It has been this way mostly because people have really tried to add much interactions with those old plot functions..
Those functions are sort of stagnant and we encourage you to use ImPlot nowadays.
In fact I have taken advantage of the recent TextLinkOpenURL() function to add a link from the demo :)
Version/Branch of Dear ImGui:
Branch: Docking, Main
Back-ends:
imgui_impl_metal.mm + imgui_impl_osx.mm
Compiler, OS:
clang, macos
Full config/build information:
No response
Details:
I've been trying for a bit to get SetItemKeyOwner(ImGuiKey_MouseWheelY) working with PlotLines(). Calling this does not seem to do anything in the current version (both main and docking) - scrolling still falls through to the parent window.
I noticed that PlotEx in imgui_widgets.cpp reads the following at line 8230 (line number is for a recent docking version):
if (!ItemAdd(total_bb, 0, &frame_bb)) // etc...
Is this intentional? I am not super familiar with the codebase so forgive me for asking rather than submitting a pull request. Changing this to:
if (!ItemAdd(total_bb, id, &frame_bb)) // etc...
fixes my issue, but not having a firm understanding of how id's/items etc work I am wary of leaving it this way.
-a
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: