implot icon indicating copy to clipboard operation
implot copied to clipboard

implot run with webassembly occur some errors in browser console

Open deloverzeus opened this issue 1 year ago • 1 comments

I have called ImGui::CreateContext(); ImPlot::CreateContext(); if (ImPlot::BeginPlot("My Plot")){ ... ImPlot::EndPlot();} But when run in browser show occur some errors: For example: fxqtest.html:1 Aborted(Assertion failed: (gp.CurrentPlot != nullptr) && "PlotX() needs to be called between BeginPlot() and EndPlot()!", at: src/implot_items.cpp,397,BeginItem); Uncaught RuntimeError: Aborted(Assertion failed: (gp.CurrentPlot != nullptr) && "PlotX() needs to be called between BeginPlot() and EndPlot()!", at: src/implot_items.cpp,397,BeginItem) at abort (fxqtest.js:1:22554) at ___assert_fail (fxqtest.js:1:39999) at 002eb962:0x14e07 at 002eb962:0x9a04 at callUserCallback (fxqtest.js:1:99385) at Object.runIter (fxqtest.js:1:116151) at Browser_mainLoop_runner (fxqtest.js:1:132745) Uncaught RuntimeError: Aborted(Assertion failed: Ctx != 0L, at: src/imgui.cpp,1547,AddMousePosEvent) at abort (fxqtest.js:1:22554) at ___assert_fail (fxqtest.js:1:39999) at 002eb962:0x42427 at 002eb962:0x2743b at HTMLCanvasElement.onMouseenter (fxqtest.js:1:172855)

deloverzeus avatar Feb 27 '24 02:02 deloverzeus

I'm running in to this same issue with native C++. Based on what I debugged, it seems the call to ImPlot::BeginPlot() fails to setup the plot because the call to ImGui::ItemAdd(plot.FrameRect, plot.ID, &plot.FrameRect) fails as the ImGui::ImGuiWindowhas a ClipRect of all zeros.

I'm not for sure why this is happening, I'm using version v1.89.8 of ImGui.

sirnacnud avatar Jan 30 '25 12:01 sirnacnud