Am 31.05.2007 um 22:54 schrieb Dov Feldstern:
Stefan Schimanski wrote:Am 31.05.2007 um 22:27 schrieb Stefan Schimanski:Ok, makes sense. The character then entered should be with the font of the character at that position.The patch: Index: src/Text.cpp =================================================================== --- src/Text.cpp (Revision 18599) +++ src/Text.cpp (Arbeitskopie) @@ -1330,8 +1331,10 @@ checkBufferStructure(cur.buffer(), cur); } - if (cur.pos() == cur.lastpos()) + if (cur.pos() == cur.lastpos()) { + cur.bv().textMetrics(this).redoParagraph(cur.pit()); setCurrentFont(cur); + } needsUpdate |= handleBibitems(cur);The question though is why the cursor must be updated at that position in the code.And another question: need we really redoParagraph() on every single backspace? It looks like we only have the problem when we reach the beginning of the line. Wouldn't it be cheaper to test for that, first?
Well, we need to set the font. We can take the font manually from the character we will be after. But we must do that before the character is removed because then the metrics are wrong. And btw, the paragraph is relayouted anyway, I am quite sure. Don't think that's so expansive, e.g. compared to drawing the whole thing.
Stefan
PGP.sig
Description: Signierter Teil der Nachricht