Fix scroll rendering artifacts by removing ScrollDC
ScrollDC shifted buffer pixels during parsing before dirty rows were rendered, causing unrendered garbage to propagate into non-dirty rows on successive scrolls. Replace with FAllDirty to repaint all rows from cell data after any scroll. With batched TextOut this costs ~250 GDI calls per scroll instead of the old 12,000, so the overhead is minimal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ca99d1d21b
commit
a96dbb3faa
1 changed files with 2 additions and 23 deletions
|
|
@ -101,7 +101,6 @@ type
|
|||
procedure RecalcCellSize;
|
||||
procedure RedrawBuffers;
|
||||
procedure ResizeScreen;
|
||||
procedure ScrollBufs(N: Integer);
|
||||
procedure SetCols(Value: Integer);
|
||||
procedure SetCursorVisible(Value: Boolean);
|
||||
procedure SetRows(Value: Integer);
|
||||
|
|
@ -761,24 +760,6 @@ begin
|
|||
end;
|
||||
|
||||
|
||||
procedure TKPAnsi.ScrollBufs(N: Integer);
|
||||
var
|
||||
R: TRect;
|
||||
I: Integer;
|
||||
ScrollY: Integer;
|
||||
begin
|
||||
if FBufDC[0] = 0 then
|
||||
Exit;
|
||||
ScrollY := N * FCellHeight;
|
||||
R.Left := 0;
|
||||
R.Top := 0;
|
||||
R.Right := FBufW;
|
||||
R.Bottom := FBufH;
|
||||
for I := 0 to 1 do
|
||||
ScrollDC(FBufDC[I], 0, -ScrollY, R, R, 0, nil);
|
||||
end;
|
||||
|
||||
|
||||
procedure TKPAnsi.DeleteChars(N: Integer);
|
||||
var
|
||||
Line: PTermLine;
|
||||
|
|
@ -864,8 +845,7 @@ begin
|
|||
GetMem(Line, SizeOf(TTermLineRec));
|
||||
AllocLine(Line);
|
||||
FScreen.Insert(0, Line);
|
||||
ScrollBufs(-1);
|
||||
FDirtyRow[0] := True;
|
||||
FAllDirty := True;
|
||||
end;
|
||||
|
||||
|
||||
|
|
@ -885,8 +865,7 @@ begin
|
|||
AllocLine(Line);
|
||||
FScreen.Add(Line);
|
||||
UpdateScrollbar;
|
||||
ScrollBufs(1);
|
||||
FDirtyRow[FRows - 1] := True;
|
||||
FAllDirty := True;
|
||||
end;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue