1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 13:19:54 +00:00

Fix calculation of selected blocks in ScriptEdit

This commit is contained in:
MiroslavR 2015-07-06 16:35:45 +02:00 committed by cc9cii
parent fb395e4dc9
commit 5dc87e5008

View file

@ -276,11 +276,11 @@ void CSVWorld::ScriptEdit::lineNumberAreaPaintEvent(QPaintEvent *event)
if(textCursor().hasSelection())
{
QString str = textCursor().selection().toPlainText();
int selectedLines = str.count("\n")+1;
int offset = str.count("\n");
if(textCursor().position() < textCursor().anchor())
endBlock += selectedLines;
endBlock += offset;
else
startBlock -= selectedLines;
startBlock -= offset;
}
painter.setBackgroundMode(Qt::OpaqueMode);
QFont font = painter.font();