TCustomGrid: incorrect ClipRect handling with goColSpanning
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
With goColSpanning the extend of a cell can cover additional cells.
In TCustomGrid.DrawRow is the following code:
for aCol:=left to Right do begin
ColRowToOffset(True, True, aCol, R.Left, R.Right);
if (R.Left>=R.Right) or not HorizontalIntersect(R, ClipArea) then
continue;
This code runs before R (the cell rectangle) is extended (which happens in TCustomDrawGrid.DefaultDrawCell).
So if the cliprect only covers the cell to the right, then the current cell will not be drawn, even if it will/would extend to the cell on the right.
In most cases the entire grid is painted, and the issue does not manifest. But if only part of the grid needs to be repainted, then this can happen.
------------------
Further more the nested proc DoDrawCell calls InterSectClipRect(Canvas.Handle, R.Left, R.Top, R.Right, R.Bottom);
So even if DefaultDrawCell is called, it can not paint the extended rect of the cell.
Mantis conversion info:
- Mantis ID: 34017
- OS: win 10
- OS Build: 10
- Platform: 64bit Intel
- Version: 1.9 (SVN)
- Fixed in version: 1.9 (SVN)
- Fixed in revision: 58708 (#e040a8ff)
- Target version: 1.10