lerpTo method

  1. @override
IGuiShape lerpTo(
  1. IGuiShape shape,
  2. double t
)
override

Linearly interpolate from this shape to other shape by an extrapolation factor t.

Implementation

@override
IGuiShape lerpTo(IGuiShape shape, double t) {
  if (shape is GuiShapePolygon) {
    return GuiShapePolygon(
        sides: lerpDouble(sides, shape.sides, t)!.toInt(),
        startAngle: GeoAngle(
            radian:
                lerpDouble(startAngle.radian, shape.startAngle.radian, t)),
        clockwise: clockwise,
        boxFit: boxFit,
        cornerRadius: lerpDouble(cornerRadius, shape.cornerRadius, t)!);
  } else {
    return GuiShapePolygon(
        sides: sides,
        startAngle: startAngle,
        clockwise: clockwise,
        boxFit: boxFit,
        cornerRadius: cornerRadius);
  }
}