new SimpleCell()
Extends
Methods
paint()
The default cell rendering function for rendering a vanilla cell.
Great care has been taken in crafting this function as it needs to perform extremely fast. Reads on the gc object are expensive but not quite as expensive as writes to it. We do our best to avoid writes, then avoid reads. Clipping bounds are not set here as this is also an expensive operation. Instead, we truncate overflowing text and content by filling a rectangle with background color column by column instead of cell by cell. This column by column fill happens higher up on the stack in a calling function from fin-hypergrid-renderer. Take note we do not do cell by cell border rendering as that is expensive. Instead we render many fewer gridlines after all cells are rendered.
- Overrides:
- Implements:
renderMultiLineText(gc, config, val)
Renders single line text.
Parameters:
Name | Type | Description |
---|---|---|
gc |
CanvasRenderingContext2D | |
config |
object | |
config.bounds |
Rectangle | The clipping rect of the cell to be rendered. |
val |
* | The text to render in the cell. |
renderSingleLineText(gc, config, val)
Renders single line text.
Parameters:
Name | Type | Description |
---|---|---|
gc |
CanvasRenderingContext2D | |
config |
object | |
config.bounds |
Rectangle | The clipping rect of the cell to be rendered. |
val |
* | The text to render in the cell. |
roundRect(gc, x, y, width, height, radius, fill, stroke)
A simple implementation of rounding a cell.
Parameters:
Name | Type | Description |
---|---|---|
gc |
CanvasRenderingContext2D | |
x |
number | the x grid coordinate of my origin |
y |
number | the y grid coordinate of my origin |
width |
number | the width I'm allowed to draw within |
height |
number | the height I'm allowed to draw within |
radius |
number | |
fill |
number | |
stroke |
number |
- Inherited From: