hoffstadt / hoffstadt/DearPyGui

Image series' "show" state failed to switch

Open
#1,962 2 comments 0 reactions 0 assignees View on GitHub
state: pending type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## Version of Dear PyGui

Version: 1.6.2.
Operating System: Windows 11

## My Issue/Question

Plot legend with build-in toggle handles didn't change the image series' 'show' state during switching.

## To Reproduce

use the code below to see there isn't any change during switching.

## Expected behavior

image serie's 'show' configuration is True when it is rendered and False otherwise.

## Screenshots/Video

None

## Additional context

Linked with issue #1961

## Standalone, minimal, complete and verifiable example
import dearpygui.dearpygui as dpg

def _on_demo_close(sender, app_data, user_data):
dpg.delete_item(sender)
dpg.delete_item("__demo_texture_container")

if __name__ == "__main__":
dpg.create_context()

plot_area_size = 800
ref_ratio = .75
dpg.create_viewport(title='Radiation Calculation', width=1080, height=720)
with dpg.window(label="Test", width=1300, height=1000, on_close=_on_demo_close, pos=(100, 100), tag="Primary"):
with dpg.plot(label="Image Plot", height= plot_area_size*ref_ratio, width= plot_area_size, tag = "Plot_Plot0",):
X_axis = dpg.add_plot_axis(dpg.mvXAxis, label="x axis", tag = "Plot_Xaxis")
Y_axis = dpg.add_plot_axis(dpg.mvYAxis, label="y axis", tag = "Plot_Yaxis")
# you may use the build-in legend and see their behavior
dpg.add_plot_legend(tag = "Plot_Legendtest_0")

texture_data1 = []
for i in range(100*100):
texture_data1.append(125/255)
texture_data1.append(100/255)
texture_data1.append(255/255)
texture_data1.append(255/255)

dpg.add_texture_registry(tag="__demo_texture_container")
dpg.add_static_texture(100, 100, texture_data1, parent="__demo_texture_container", tag="__demo_static_texture_1", label="Static Texture 1")
dpg.add_image_series("__demo_static_texture_1", [0, 0], [100, 100], label="static 1", parent = "Plot_Yaxis", tag = "Plot_Imtest_0")
last_config = dpg.get_item_configuration("Plot_Imtest_0")

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.set_primary_window("Primary", True)

count = 0
while dpg.is_dearpygui_running():
present_config = dpg.get_item_configuration("Plot_Imtest_0")
if count%1000 == 0:
print(f"regular configure\npresent config = {str(present_config)}\n*******************\n\n")
count = 0

for i in present_config:
if present_config[i] != last_config[i]:
print(f"diff at config {i} with last value{last_config[i]} and present value{present_config[i]}")

if dpg.is_key_pressed(dpg.mvKey_Escape):
break

children = dpg.get_item_children("Plot_Legendtest_0")
for i in children:
for ii in children[i]:
print(dpg.get_item_alias(children[1][i]))
children = dpg.get_item_children( "Plot_Imtest_0")
for i in children:
for ii in children[i]:
print(dpg.get_item_alias(children[1][i]))

dpg.render_dearpygui_frame()
last_config = present_config
count += 1

dpg.destroy_context()

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.