calcPortalTravel method

RRect calcPortalTravel(
  1. Size size,
  2. double offset,
  3. double dotOffset
)

Calculates the shape of a dot while portal-traveling form last-to-first dot or form first-to-last dot

Implementation

RRect calcPortalTravel(Size size, double offset, double dotOffset) {
  final yPos = size.height / 2;
  var width = dotOffset * (_effect.dotHeight / 2);
  var height = dotOffset * (_effect.dotWidth / 2);
  var xPos = offset;
  return RRect.fromLTRBR(
    xPos - height,
    yPos - width,
    xPos + height,
    yPos + width,
    Radius.circular(dotRadius.x * dotOffset),
  );
}