Skip to content

Commit

Permalink
Fixed draw buffer pause
Browse files Browse the repository at this point in the history
The draw buffer now caches Home and Search pages as well.
  • Loading branch information
Codrax committed Jan 17, 2024
1 parent 9f95e1f commit 5ea2e40
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions MainUI.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3465,6 +3465,15 @@ procedure TUIForm.HomeDrawPaint(Sender: TObject);
ScrollPosition.PageSize := 0;
ScrollPosition.Max := MaxScroll - HomeDraw.Height;
end;

// Copy draw buffer
with TPaintBox(Sender).Canvas do
begin
LastDrawBuffer.Width := ClipRect.Width;
LastDrawBuffer.Height := ClipRect.Height;

LastDrawBuffer.Canvas.CopyRect(ClipRect, TPaintBox(Sender).Canvas, ClipRect);
end;
end;

procedure TUIForm.PopupGeneralInfo(Sender: TObject);
Expand Down Expand Up @@ -6655,6 +6664,15 @@ procedure TUIForm.SearchDrawPaint(Sender: TObject);
ScrollPosition.PageSize := 0;
ScrollPosition.Max := Y + ScrollPosition.Position;
end;

// Copy draw buffer
with TPaintBox(Sender).Canvas do
begin
LastDrawBuffer.Width := ClipRect.Width;
LastDrawBuffer.Height := ClipRect.Height;

LastDrawBuffer.Canvas.CopyRect(ClipRect, TPaintBox(Sender).Canvas, ClipRect);
end;
end;

procedure TUIForm.Search_ButtonClick(Sender: TObject);
Expand Down

0 comments on commit 5ea2e40

Please sign in to comment.