deltaTeleport method

void deltaTeleport(
  1. double width,
  2. double height
)

Implementation

void deltaTeleport(double width, double height) {
  double x = pos.dx + dx;
  double y = pos.dy + dy;
  pos = Offset(
      x < -size / 2
          ? width + size / 2
          : x > width + size / 2
              ? -size / 2
              : x,
      y < -size / 2
          ? height + size / 2
          : y > height + size / 2
              ? -size / 2
              : y);
}