]> git.lyx.org Git - features.git/commit
Avoid breaking kerning with continuous spell checking
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 14 Jul 2015 21:45:41 +0000 (23:45 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 15 Jul 2015 10:13:24 +0000 (12:13 +0200)
commit4796e6b33703a4308c39d34972afeae44dab59e0
tree308e79ba715331430f81a18838cbcb4ff098d0d0
parent1136bc4fb276e9182fb461ffdfbddcc58b622762
Avoid breaking kerning with continuous spell checking

There is a mismatch between the way text is tokenized in Row objects
and the way it is shown on screen. When metrics are computed,
continuous spell checking has not been done yet. Yet, the row painter
explicitly breaks words at spell status boundaries. This creates
problem with a text like "PMP," (see bug #9649), where there is a
negative kerning before the comma.

This is solved by not taking in account spell status when drawing
text, and drawing spell underlines separately.

* replace Paragraph::isSameSpellRange with new method getSpellRange.

* merge RowPainter::paintChars into RowPainter::paintFromPos

* move the actual text painting code into the new paintTextAndSel.

* merge some code from paintFromPos to paintMisspelledMark

* in paintMisspelledMark, scan the string which needs to be annotated
  and add dashed line below text marked as misspelled.

Fixes bug #9649.
src/Paragraph.cpp
src/Paragraph.h
src/RowPainter.cpp
src/RowPainter.h