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
dpg.show_item() and dpg.hide_item() can dynamically show and hide the legend on a regular plot, but do not work on the legend within dpg.subplots (the one belonging to dpg.subplots itself).
This is caused by static_cast in DearPyGui::set_configuration for mvPlotLegendConfig. I bet it was supposed to be dynamic_cast. Currently, the if can't ever enter the mvSubPlots branch.
Moreover, if plot_legend is added directly to dpg.stage, that static_cast will lead to memory corruption as the code tries to modify bytes beyond the mvStage object. I couldn't get it crash but it's pure luck.
To Reproduce
Steps to reproduce the behavior:
Call dpg.show_item() or dpg.hide_item() on a plot_legend within dpg.subplots, and see if it works. Alternatively, run the below example and click the show/hide buttons.
Expected behavior
Show/hide should work for both plot legend and subplots legend.
Screenshots/Video
None.
Standalone, minimal, complete and verifiable example
Version of Dear PyGui
Version: 1.11.2
Operating System: Windows 10
My Issue/Question
dpg.show_item()
anddpg.hide_item()
can dynamically show and hide the legend on a regular plot, but do not work on the legend withindpg.subplots
(the one belonging todpg.subplots
itself).This is caused by
static_cast
inDearPyGui::set_configuration
formvPlotLegendConfig
. I bet it was supposed to bedynamic_cast
. Currently, theif
can't ever enter themvSubPlots
branch.Moreover, if
plot_legend
is added directly todpg.stage
, thatstatic_cast
will lead to memory corruption as the code tries to modify bytes beyond themvStage
object. I couldn't get it crash but it's pure luck.To Reproduce
Steps to reproduce the behavior:
Call
dpg.show_item()
ordpg.hide_item()
on aplot_legend
withindpg.subplots
, and see if it works. Alternatively, run the below example and click the show/hide buttons.Expected behavior
Show/hide should work for both plot legend and subplots legend.
Screenshots/Video
None.
Standalone, minimal, complete and verifiable example
The text was updated successfully, but these errors were encountered: