SynEdit: Fix invalidation, when selecting bottom to top

git-svn-id: trunk@34936 -
This commit is contained in:
martin 2012-01-25 16:20:44 +00:00
parent 151953196d
commit 8b3cf80474
2 changed files with 8 additions and 2 deletions

View File

@ -396,7 +396,7 @@ begin
- TopLine + 2) * LineHeight);
{$IFDEF VerboseSynEditInvalidate}
DebugLn(['TCustomSynEdit.InvalidateGutterLines ',DbgSName(self), ' FirstLine=',FirstTextLine, ' LastLine=',LastTextLine, ' rect=',dbgs(rcInval)]);
DebugLn(['TCustomSynEdit.InvalidateTextLines ',DbgSName(self), ' FirstLine=',FirstTextLine, ' LastLine=',LastTextLine, ' rect=',dbgs(rcInval)]);
{$ENDIF}
if (rcInval.Top < rcInval.Bottom) and (rcInval.Left < rcInval.Right) then
InvalidateRect(Handle, @rcInval, FALSE);

View File

@ -2478,6 +2478,9 @@ begin
if FOldTopView <> TopView then
FFoldedLinesView.TopLine := FOldTopView;
if (LastLine <> -1) and (LastLine < FirstLine) then
SwapInt(FirstLine, LastLine);
FPaintArea.InvalidateGutterLines(FirstLine-1, LastLine-1);
FFoldedLinesView.TopLine := TopFoldLine;
@ -2495,7 +2498,7 @@ begin
if sfPainting in fStateFlags then exit;
if Visible and HandleAllocated then begin
{$IFDEF VerboseSynEditInvalidate}
DebugLnEnter(['TCustomSynEdit.InvalidateTektLines ',DbgSName(self), ' FirstLine=',FirstLine, ' LastLine=',LastLine]);
DebugLnEnter(['TCustomSynEdit.InvalidateTextLines ',DbgSName(self), ' FirstLine=',FirstLine, ' LastLine=',LastLine]);
{$ENDIF}
if (FirstLine = -1) and (LastLine = -1) then begin
FPaintArea.InvalidateTextLines(-1, -1);
@ -2505,6 +2508,9 @@ begin
if FOldTopView <> TopView then
FFoldedLinesView.TopLine := FOldTopView;
if (LastLine <> -1) and (LastLine < FirstLine) then
SwapInt(FirstLine, LastLine);
FPaintArea.InvalidateTextLines(FirstLine-1, LastLine-1);
FFoldedLinesView.TopLine := TopFoldLine;