Re-add the space character as a document terminator
With change 208496091d
the space character
was replaced with a visual document terminator character. However this
meant that if the whitespace was visualized without the document
terminator character visualized then clicking after the text would cause
it to be positioned off by one.
By bringing back the space character when the terminator is not being
visualized then it will correctly place the cursor at the end of the
text.
Change-Id: I335c1773a37a654f3196bd350562e8f92ffd5369
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
parent
dbfd7f304c
commit
9b3a7ece47
@ -1569,12 +1569,13 @@ void QTextEngine::validate() const
|
|||||||
layoutData = new LayoutData();
|
layoutData = new LayoutData();
|
||||||
if (block.docHandle()) {
|
if (block.docHandle()) {
|
||||||
layoutData->string = block.text();
|
layoutData->string = block.text();
|
||||||
if (block.next().isValid()) {
|
const bool nextBlockValid = block.next().isValid();
|
||||||
if (option.flags() & QTextOption::ShowLineAndParagraphSeparators)
|
if (!nextBlockValid && option.flags() & QTextOption::ShowDocumentTerminator) {
|
||||||
layoutData->string += QChar(0xb6);
|
|
||||||
} else if (option.flags() & QTextOption::ShowDocumentTerminator) {
|
|
||||||
layoutData->string += QChar(0xA7);
|
layoutData->string += QChar(0xA7);
|
||||||
|
} else if (option.flags() & QTextOption::ShowLineAndParagraphSeparators) {
|
||||||
|
layoutData->string += QLatin1Char(nextBlockValid ? 0xb6 : 0x20);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
layoutData->string = text;
|
layoutData->string = text;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user