Skip to content

get_item_configuration on draw_polygon fails #2462

Open
@v-ein

Description

@v-ein

Version of Dear PyGui

Version: 2.0.0
Operating System: Windows

My Issue/Question

For polygons created with draw_polygon, the points are not reported correctly by get_item_configuration. If there are 4 or fewer points, it reports a list of NULLs (whatever that means), otherwise it simply fails with an IndexError.

To Reproduce

Steps to reproduce the behavior:

  1. Create a polygon.
  2. Call get_item_configuration.

Expected behavior

Report the actual list of points passed to draw_polygon.

Screenshots/Video

Image

Standalone, minimal, complete and verifiable example

import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.setup_dearpygui()
dpg.create_viewport(title=f"Test - {dpg.get_dearpygui_version()}", width=700, height=750)

with dpg.window():
    # This one succeeds, but the "points" entry contains something weird
    print("4 points:")
    poly = dpg.draw_polygon([(x, x) for x in range(4)])
    print(dpg.get_item_configuration(poly))
    # This one fails
    print("5 points:")
    poly = dpg.draw_polygon([(x, x) for x in range(5)])
    print(dpg.get_item_configuration(poly))

dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions