From bdac446d51d3040b7e234c64c1d0544ec8c256ac Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Sat, 21 Jan 2023 09:47:33 +0100 Subject: [PATCH] fix not all characters shown when line contains tabs --- src/ui/bigtext/bigtext.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ui/bigtext/bigtext.py b/src/ui/bigtext/bigtext.py index 38f5b30..b3a3c36 100644 --- a/src/ui/bigtext/bigtext.py +++ b/src/ui/bigtext/bigtext.py @@ -504,12 +504,9 @@ class InnerBigText(QWidget): y_line_offset = self.char_height for line in self.lines: text = line.line_prepared_for_display() - leftmost_visible_char_index = line.column_to_char(self._left_offset) - rightmost_visible_char_index = line.column_to_char(self._left_offset + math.ceil(self.columns_shown())) - text = text[ - leftmost_visible_char_index:rightmost_visible_char_index] # reduce string to the visible section before drawing + text = text[self._left_offset:self._left_offset + math.ceil( + self.columns_shown())] # reduce string to the visible section before drawing painter.drawText(0, y_line_offset, text) - # painter.drawText(left_offset, y_line_offset, text) y_line_offset = y_line_offset + self.char_height painter.end()