Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScrollTextBlock not rending text correctly once text row length is GTE viewport rows/y dimension #172

Open
blubaru14 opened this issue Jan 20, 2022 · 0 comments
Labels
Bug Something isn't working

Comments

@blubaru14
Copy link

blubaru14 commented Jan 20, 2022

Describe the bug
I have a ScrollTextBlock and I am writing a string to it once per second. It works great until the _text_lines length is equal or greater than the viewport rows of the textblock. If the string has a single newline at the end of it then the string gets written to _text_lines but it does not properly get rendered in the text block. Once I send another string, the previous string then shows up in the text box.

However if I send strings with double newlines there is no issue. This is shown in the screenshots

Note: I attempted to call _draw() on the ScrollTextBlock but this does not resolve the issue.

thanks. appreciate your time

To Reproduce
Steps to reproduce the behavior:

  1. Create a ScrollTextBlock
  2. Create a loop and write() to it every second with a string that has newline at the end
  3. Once your text gets to a row length >= to the viewport y dimension you will see that the strings are being rendered in this strange manner.

Expected behavior
Each string/line that is written to be rendered correctly without having to do double newlines as a workaround.

Screenshots
Single newline (Viewport has 13 rows in this case):
single_newline

The textbox does not render the text of the last string, however you can go left and right on the line to the length of the string that should be displayed. It is supposed to display "Closing Serial"

Double newline (Viewport has 13 rows in this case):
double_newline

The textbox renders the strings just fine.

**Environment

  • OS: [e.g. Ubuntu 20.04]
  • Terminal: gnome-terminal
  • Version: [ex. v1.0.4]
@blubaru14 blubaru14 added the Bug Something isn't working label Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant