DearPyGui icon indicating copy to clipboard operation
DearPyGui copied to clipboard

Line thickness in Drawing-API

Open 1081 opened this issue 2 years ago • 0 comments

Version: 1.6.2 (and below)

dearpygui.draw_line(thickness= expects a float, but the line thickness only changes (noticeably) in integer steps. I am not able to draw a line with 0.5 thickness.

Unfortunately, the difference between thickness 1 and 2 is quite large. In my application, I can effectively only use line thickness 1.

Example thickness = 1: Screenshot 2022-05-05 at 21 06 01

Example thickness = 2: Screenshot 2022-05-05 at 21 06 31

Is it possible to make the different in line sizes (especially 0.5) more distinctive/identifiable?

import dearpygui.dearpygui as dpg

dpg.create_context()

with dpg.window(label="Issue: line thickness", width=400, height=400):
    with dpg.drawlist(width=200, height=200):
        dpg.draw_line([0, 0], [100, 0], thickness=0.25)
        dpg.draw_line([0, 5], [100, 5], thickness=0.5)
        dpg.draw_line([0, 10], [100, 10], thickness=0.75)
        dpg.draw_line([0, 15], [100, 15], thickness=1.0)
        dpg.draw_line([0, 20], [100, 20], thickness=1.25)

        dpg.draw_line([0, 30], [100, 30], thickness=1.5)
        dpg.draw_line([0, 35], [100, 35], thickness=1.75)
        dpg.draw_line([0, 40], [100, 40], thickness=2.0)
        dpg.draw_line([0, 45], [100, 45], thickness=2.25)

        dpg.draw_line([0, 55], [100, 55], thickness=2.5)
        dpg.draw_line([0, 60], [100, 60], thickness=2.75)
        dpg.draw_line([0, 65], [100, 65], thickness=3.0)

        dpg.draw_line([150, 100], [100, 0], thickness=0.25)
        dpg.draw_line([150, 100], [100, 5], thickness=0.5)
        dpg.draw_line([150, 100], [100, 10], thickness=0.75)
        dpg.draw_line([150, 100], [100, 15], thickness=1.0)
        dpg.draw_line([150, 100], [100, 20], thickness=1.25)
        dpg.draw_line([150, 100], [100, 30], thickness=1.5)
        dpg.draw_line([150, 100], [100, 35], thickness=1.75)
        dpg.draw_line([150, 100], [100, 40], thickness=2.0)
        dpg.draw_line([150, 100], [100, 45], thickness=2.25)
        dpg.draw_line([150, 100], [100, 55], thickness=2.5)
        dpg.draw_line([150, 100], [100, 60], thickness=2.75)
        dpg.draw_line([150, 100], [100, 65], thickness=3.0)

dpg.create_viewport(width=400, height=400)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()

dpg.destroy_context()

Looking at different screen resolutions, I realize that this is not an easy task. Most likely, this is just the way ImGui renders lines. But maybe there is some way to adjust the render settings?


Apple Macbook Screen resolution: 2560 x 1600

Screenshot 2022-05-07 at 06 56 02

Zoom: 0.25 and 1.25 are slightly different (when I squeeze my eyes) but 0.5, 1.0 and 1.25 are the same. Screenshot 2022-05-07 at 06 56 47


Windows: Screen resolution: 2048 × 1080

2022-05-07 - 07Uhr07 - 000079 - Dear PyGui

Zoom: Screenshot 2022-05-07 at 07 13 01

1081 avatar May 07 '22 05:05 1081