RevGrid - v0.9.3
    Preparing search index...

    Render the grid with consolidated column rects.

    Paints all the cells of a grid, one column at a time.

    First, a background rect is drawn using the grid background color.

    Then, if there are any columns with their own background color that differs from the grid background color, these are consolidated and the consolidated groups of column backgrounds are all drawn before iterating through cells. Note that these column rects are not suitable for clipping overflow text from previous columns. If you have overflow text, either turn on clipping (grid.properties.columnClip = true but big performance hit) or turn on one of the truncateTextWithEllipsis options.

    try...catch surrounds each cell paint in case a cell renderer throws an error. The error message is error-logged to console AND displayed in cell.

    Regading clipping. The reason for clipping is to prevent text from overflowing into the next column. However there is a serious performance cost.

    For performance reasons do not set up a clipping region for each cell. However, iff grid property columnClip is truthy, this grid renderer will set up a clipping region to prevent text overflow to right. If columnClip is null, a clipping region will only be set up on the last column. Otherwise, there will be no clipping region.

    The idea of clipping just the last column is because in addition to the optional graphics clipping, we also clip ("truncate") text. Text can be truncated conservatively so it will never overflow. The problem with this is that characters vanish as they hit the right cell boundary, which may or may be obvious depending on font size. Alternatively, text can be truncated so that the overflow will be a maximum of 1 character. This allows partial characters to be rendered. But this is where graphics clipping is required.

    When renderering column by column as this particular renderer does, and when the background color of the next cell to the right is opaque (alpha = 1), clipping can be turned off because each column will overpaint any text that overflowed from the one before. However, any text that overflows the last column will paint into unused canvas region to the right of the grid. This is the raison d'être for "clip last column only" option mentioned above (when columnClip is set to null). To avoid even this performance cost (of clipping just the last column), column widths can be set to fill the available canvas.

    Note that text never overflows to left because text starting point is never less than 0. The reason we don't clip to the left is for cell renderers that need to re-render to the left to produce a merged cell effect, such as grouped column header.

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    key: string
    partial: boolean

    Methods

    • We opted to not paint borders for each cell as that was extremely expensive. Instead we draw grid lines here.

      Returns void