Capsule constructor

Capsule(
  1. ShapeConfig config,
  2. double radius,
  3. double height
)

Capsule shape

config configuration of the shape

radius the top and bottom radius of the Capsule

height the height of the Capsule

Implementation

Capsule(ShapeConfig config, this.radius, this.height):super(config) {
  type = Shapes.capsule;
  halfHeight = height * 0.5;
  start = relativePosition..y += halfHeight;
  end = relativePosition..y -= halfHeight;
}