render method

  1. @override
void render(
  1. Canvas canvas
)
override

Implementation

@override
void render(Canvas canvas) {
  super.render(canvas);
  if (_measuredWidth == null) {
    _measuredWidth = textConfig.measureTextWidth(text);
    _measuredHeight = textConfig.measureTextHeight(text);
    position = position.copyWith(
      size: Vector2(_measuredWidth!, _measuredHeight!),
    );
  }

  textConfig.render(
    canvas,
    text,
    Vector2(this.position.left, this.position.top),
  );
}