handleOrientationChanges method

void handleOrientationChanges(
  1. Size size
)

Implementation

void handleOrientationChanges(Size size) {
  boardSizePixels = size;
  var centerPosition =
      Vector2(boardSizePixels.width / 2, boardSizePixels.height / 2);

  var positions = _calculateItemPositions(centerPosition);
  setChildBodiesToStatic();
  state = state.updateItemPositions(
    centerPosition,
    positions,
    // parent is prioritized -> no need to calculate
    configuration.parentRadius,
    _childRadius,
  );
  notifyListeners();
  setChildBodiesToDynamic();
}