mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 08:23:53 +00:00
Fix calculation of selected blocks in ScriptEdit
This commit is contained in:
parent
e89614a35d
commit
13f289d1a5
1 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue