DearPyGui
DearPyGui copied to clipboard
Line thickness in Drawing-API
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:
Example thickness = 2:
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

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.
Windows: Screen resolution: 2048 × 1080
Zoom: