paint method
Paints the bitmap texture onto the canvas using its current transformation matrix and rendering properties. This method also handles rendering any filters that have been applied to the GBitmap.
If the texture property is null, this method does nothing.
If the texture property has a scale9Grid defined, then this method will
call _adjustScaleGrid
to adjust the pivot and scale of the bitmap to
properly render the texture.
Overrides the paint method of GDisplayObject. It is called by the parent display object during rendering if the object is visible.
Params:
canvas
: The canvas onto which the texture will be painted.
Returns:
- void
Implementation
@override
void paint(ui.Canvas canvas) {
if (texture == null) {
return;
}
_hasScale9Grid = texture!.scale9Grid != null;
if (_hasScale9Grid) {
_adjustScaleGrid();
}
super.paint(canvas);
}