From 2c8a7d29dd0d18959dcbdee9c4f2ed94224a8e50 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Mon, 24 Jan 2022 16:08:24 +0800 Subject: [PATCH] - fix: indent lines displayed at wrong position, when there are folded lines --- NEWS.md | 1 + RedPandaIDE/qsynedit/TextPainter.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index dd190cdb..10976ea7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -19,6 +19,7 @@ Red Panda C++ Version 0.13.3 - fix: project files' charset settings doesn't work correctly - enhancement: add exec charset option to compiler set settings - fix: when open a file, all blank lines's indents are removed. + - fix: indent lines displayed at wrong position, when there are folded lines Red Panda C++ Version 0.13.2 - fix: "delete and exit" button in the environtment / folder option page doesn't work correctly diff --git a/RedPandaIDE/qsynedit/TextPainter.cpp b/RedPandaIDE/qsynedit/TextPainter.cpp index 23a69019..b083d499 100644 --- a/RedPandaIDE/qsynedit/TextPainter.cpp +++ b/RedPandaIDE/qsynedit/TextPainter.cpp @@ -720,10 +720,11 @@ void SynEditTextPainter::PaintFoldAttributes() // Now loop through all the lines. The indices are valid for Lines. for (cRow = aFirstRow; cRow<=aLastRow;cRow++) { vLine = edit->rowToLine(cRow); + qDebug()< edit->mLines->count() && edit->mLines->count() > 0) break; // Set vertical coord - Y = (vLine - edit->mTopLine) * edit->mTextHeight; // limit inside clip rect + Y = (cRow - edit->mTopLine) * edit->mTextHeight; // limit inside clip rect if (edit->mTextHeight % 2 == 1 && vLine % 2 == 0) { Y++; }