hoffstadt / hoffstadt/DearPyGui

add_text wrap keyword relative to window, not start of textfield

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

Description

## Version of Dear PyGui

Version: 0.8.64
Operating System: Windows 10 and Ubuntu 20.04

## My Issue/Question

The text field created with `add_field` seems to `wrap` at the point specified relative to the window start,
not the start of the textfield.

Is this a bug or expected behavior?

## To Reproduce

Run this code:

```
#!/usr/bin/env python

import dearpygui.dearpygui as dpg

LOREM_IPSUM = '''Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'''

with dpg.window():
with dpg.group(horizontal=True):
dpg.add_text('Hello world!')
dpg.add_text(LOREM_IPSUM, indent=200, wrap=600)

dpg.add_text(LOREM_IPSUM, wrap=600)

dpg.start_dearpygui()
```

## Expected behavior

The top Lorem Ipsum should wrap 200 pixels right of where the lower Lorem Ipsum wraps the text.

## Screenshots/Video

![dearpygui_text_wrap_issue#](https://user-images.githubusercontent.com/23728166/135145677-31261545-2ad6-4ebb-8a05-ae4956e27e92.png)

## Standalone, minimal, complete and verifiable example

Same as above:

```
#!/usr/bin/env python

import dearpygui.dearpygui as dpg

LOREM_IPSUM = '''Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'''

with dpg.window():
with dpg.group(horizontal=True):
dpg.add_text('Hello world!')
dpg.add_text(LOREM_IPSUM, indent=200, wrap=600)

dpg.add_text(LOREM_IPSUM, wrap=600)

dpg.start_dearpygui()
```

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.