hoffstadt / hoffstadt/DearPyGui

Line thickness in Drawing-API

Open
#1,755 0 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: 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?

```python
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](https://user-images.githubusercontent.com/11081331/167239507-05a50c3d-75a8-414d-b8a9-9eb376d3f691.png)

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

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.