From: Flávio E. <et...@us...> - 2008-06-05 23:13:33
|
Update of /cvsroot/synedit/SynEdit/Source In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32416 Modified Files: Tag: UtterUnstable SynEdit.pas Log Message: - Fix compilation (fInvalidRect vs fInvalidateRect). - Somewhat silly optimization: avoid unecessary canvas invalidation in SetTopLine. - Keep caret position after SelectAll. Index: SynEdit.pas =================================================================== RCS file: /cvsroot/synedit/SynEdit/Source/SynEdit.pas,v retrieving revision 1.389.2.100 retrieving revision 1.389.2.101 diff -u -d -r1.389.2.100 -r1.389.2.101 --- SynEdit.pas 13 Feb 2008 04:50:34 -0000 1.389.2.100 +++ SynEdit.pas 5 Jun 2008 23:13:30 -0000 1.389.2.101 @@ -41,7 +41,7 @@ //todo: Move WordWrap glyph to the WordWrap plugin. //todo: remove the several Undo block types //todo: always use TSynTextContainer? -//todo: check whether fInvalidateRect is really a performence gain +//todo: check whether fInvalidRect is really a performence gain {$IFNDEF QSYNEDIT} unit SynEdit; @@ -3037,7 +3037,7 @@ Inc( LastPt.Char, Length(Lines[LastPt.Line - 1]) ) else LastPt.Line := 1; - SetCaretAndSelection(LastPt, BufferCoord(1, 1), LastPt); + SetCaretAndSelection(CaretXY, BufferCoord(1, 1), LastPt); // Selection should have changed... StatusChanged([scSelection]); end; @@ -3781,7 +3781,9 @@ if Abs(Delta) < LinesInWindow then begin ScrollCanvas(0, fLineHeight * Delta, 0, 0); - OffsetRect(fInvalidateRect, 0, fLineHeight * Delta); + OffsetRect(fInvalidRect, 0, fLineHeight * Delta); + // Somewhat silly optimization: avoid unecessary invalidation + IntersectRect(fInvalidRect, fInvalidRect, ClientRect); end else Invalidate; |