drawEarth method

void drawEarth(
  1. Canvas canvas,
  2. Size size,
  3. SpaceViewModel viewModel,
  4. SpaceConfig config,
)

DrawEarth

Draws the earth

Draws the earth based on it's calculated position Shadow is drawn as a overlay, opposite the sun's position

Implementation

void drawEarth(
    Canvas canvas, Size size, SpaceViewModel viewModel, SpaceConfig config) {
  _imageMap["earth"]?.drawRotatedSquare(
      canvas: canvas,
      size: viewModel.earthSize,
      offset: viewModel.earthOffset,
      rotation: viewModel.earthRotation,
      paint: standardPaint);

  _imageMap["shadow"]?.drawRotatedSquare(
      canvas: canvas,
      size: viewModel.earthSize,
      offset: viewModel.earthOffset,
      rotation: viewModel.sunRotation,
      paint: standardPaint);
}