Recent

Author Topic: TDrawGrid does not paint entire canvas  (Read 1066 times)

PatBayford

  • Full Member
  • ***
  • Posts: 125
TDrawGrid does not paint entire canvas
« on: August 09, 2017, 11:35:33 pm »
I have a converted Delhi application that uses TDrawGrid and TImageList to produce an image on a from. In  general the drawing works fine, however, if the user has to use the scrollbars, any portion of the grid outside the original boundary appears blank, including cells which were drawn correctly originally. Have I missed a significant switch somewhere, or is this a bug?
This is the cell drawing code
Code: Pascal  [Select]
  1. procedure TJigsawGameMainForm.dgGameDrawCell(Sender: TObject; aCol,
  2.   aRow: Integer; aRect: TRect; aState: TGridDrawState);
  3. var i: Integer;
  4. begin
  5.   i := Game.DrawGameCell(ACol, ARow, aRect, aState);
  6.   if (i > -1) then
  7.     Game.PieceImages.Draw(Frame1_1.dgGame.Canvas,
  8.       ACol*(Frame1_1.dgGame.DefaultColWidth),
  9.       ARow*(Frame1_1.dgGame.DefaultRowHeight),i,True)
  10.   else
  11.   with Frame1_1.dgGame.Canvas do
  12.   begin
  13.     Brush.Color := clWindow;
  14.     FillRect(aRect);
  15.   end;
  16. end;
  17.  
Lazarus 1.8.0 FPC 3.0.2 SVN 56594 Windows 10 64bit (i386-win32-win32/win64)