Commit 53ce8fd8 authored by C. Boemann's avatar C. Boemann
Browse files

Fix selecting text across page boundries if the same paragraph continues on the next page.

Before wrong part of the text was selected, and also it prevented selection of text in footnotes
parent 31f686b1
......@@ -197,9 +197,16 @@ KoPointedAt KoTextLayoutArea::hitTest(const QPointF &p, Qt::HitTestAccuracy accu
for (int i = 0; i < layout->lineCount(); i++) {
QTextLine line = layout->lineAt(i);
if (block == m_startOfArea->it.currentBlock() && line.textStart() < m_startOfArea->lineTextStart) {
continue; // this line is part of a previous layoutArea
}
QRectF lineRect = line.naturalTextRect();
if (point.y() > line.y() + line.height()) {
pointedAt.position = block.position() + line.textStart() + line.textLength();
if (block == m_endOfArea->it.currentBlock() && line.textStart() + line.textLength() >= m_endOfArea->lineTextStart) {
pointedAt.position = block.position() + line.xToCursor(point.x());
break; // this and following lines are part of a next layoutArea
}
continue;
}
if (accuracy == Qt::ExactHit && point.y() < line.y()) { // between lines
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment