Skip to content

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

@wolves-fc

Description

@wolves-fc

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions