Make sure scroll past end margin cannot be negative

This commit is contained in:
Veronica K. B. Olsen
2020-10-11 21:43:26 +02:00
parent 9c75ed5b06
commit 77ec41a820
+2 -1
View File
@@ -440,7 +440,8 @@ class GuiDocEditor(QTextEdit):
if self.mainConf.scrollPastEnd:
docFrame = self.qDocument.rootFrame().frameFormat()
docFrame.setBottomMargin(wH - uM - lM - 5*self.theTheme.fontPixelSize)
docMargin = wH - uM - lM - 5*self.theTheme.fontPixelSize
docFrame.setBottomMargin(max(0, docMargin))
self.qDocument.rootFrame().setFrameFormat(docFrame)
return