Problem: 1613968

Title: (GridView) DrawRangeOfCells Calculates Wrong

Received: Dec 17 1996 5:13PM


The TGridView::DrawRangeOfCells bug identified in R11 and reported here in August by Jonathan Pierce still exists in R12. For the record, the fix that he proposed is:

FROM:

VPoint insetOffset(fColInset / 2, fRowInset / 2);
for (CCellIterator iter(this, startCell, stopCell, fDrawRowsForward, fDrawColsForward, fDrawRowMajor); iter; ++iter)
{
   VRect localVRect(CellToVRect(iter));
   if (!VRect(localVRect & aRect).Empty() && RectInRgn(&ViewToQDRect(localVRect), drawableRegion))
      DrawCell(iter, localVRect + insetOffset);
}
TO:
VRect insetOffset(fColInset / 2, fRowInset / 2, -(fColInset / 2), -(fRowInset / 2));
for (CCellIterator iter(this, startCell, stopCell, fDrawRowsForward, fDrawColsForward, fDrawRowMajor); iter; ++iter)
{
   VRect localVRect(CellToVRect(iter));
   localVRect += insetOffset;
   if (!VRect(localVRect & aRect).Empty() && RectInRgn(&ViewToQDRect(localVRect), drawableRegion))
      DrawCell(iter, localVRect);
}

Fix:

UGridView.cp: the suggested fix was made.