Closed cca32 closed 2 years ago
You are creating and destroying the ImPlot context every frame. You need to call each of these only once in the application's lifetime, ideally wherever ImGui::CreateContext
and ImGui::DestroyContext
are called.
omg, i'm so sorry. i should have noticed when it would let me scroll out for a millisecond then instantly snap back on the next frame. this solves the issue
I apologize if this is a simple fix that I'm missing. I've tried everything possible. I'm also fairly new to the
Dear ImGui
andImPlot
style.I have the following code to re-create the simple line-graph from the demo.
It works as expected. It graphs
y = 2*x
. Problems I can't figure out: 1) the zoom-out feature from mouse scroll-wheel on the graph does not work though ( it also doesn't work in the demo. but works in the demo from the url) 2) if i replace theSetUpAxesLimits
with anything else likeImPlotAxisFlags_AutoFit
, the graph just defaults to some values and doesn't move. nothing works on moving it. even the auto-fit demo doesn't move. its stuck like this:I am using
imgui_impl_dx12.cpp
backend withgcc 11.2
on windows. i'm also using thedocking
branch fromDear ImGui
sorry if this is a configuration. i can't figure out why the graph won't move. i've tried looking through all the various plot flags, window flags, etc. there doesn't seem to be a reason why it shouldn't work. also the demo doesn't work on my machine as demonstrated on the web-page (the scroll-zoom, auto-fit)