generateNextTranslation method

Offset generateNextTranslation(
  1. {double width,
  2. double height,
  3. Size nextSize,
  4. double nextScale}
)

Implementation

Offset generateNextTranslation(
    {double width, double height, Size nextSize, double nextScale}) {
  final availableXOffset = ((nextSize.width - width) / 2);
  final availableYOffset = ((nextSize.height - height) / 2);

  final x = _randomValue(-1 * availableXOffset, availableXOffset);
  final y = _randomValue(-1 * availableYOffset, availableYOffset);
  return Offset(x, y);
}