From b80ff750fbcde2009557b2fc246ddcdd9c8fca2d Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Tue, 18 Aug 2020 00:33:15 +0200 Subject: [PATCH] A bit less aggressive version off the redraw text hack --- nw/gui/build.py | 4 +--- nw/gui/docviewer.py | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/nw/gui/build.py b/nw/gui/build.py index c13a3911..0370e23c 100644 --- a/nw/gui/build.py +++ b/nw/gui/build.py @@ -1040,9 +1040,7 @@ class GuiBuildNovelDocView(QTextBrowser): # This forces a repaint of the text, It's a hack to fix an occational # issue where the find/replace above interfers with the rendering and # leaves parts of the document blank. - textWidth = self.qDocument.textWidth() - self.qDocument.setTextWidth(textWidth - 5) - self.qDocument.setTextWidth(textWidth) + self.qDocument.setTextWidth(self.qDocument.textWidth()) return diff --git a/nw/gui/docviewer.py b/nw/gui/docviewer.py index 0f7e81cd..63a41e9b 100644 --- a/nw/gui/docviewer.py +++ b/nw/gui/docviewer.py @@ -183,9 +183,7 @@ class GuiDocViewer(QTextBrowser): # This forces a repaint of the text, It's a hack to fix an occational # issue where the find/replace above interfers with the rendering and # leaves parts of the document blank. - textWidth = self.qDocument.textWidth() - self.qDocument.setTextWidth(textWidth - 5) - self.qDocument.setTextWidth(textWidth) + self.qDocument.setTextWidth(self.qDocument.textWidth()) return True