code: private float getMaxScale(@NonNull Canvas canvas) {
      float maxScaleX = canvas.getWidth() / (float) composition.getBounds().width();
      float maxScaleY = canvas.getHeight() / (float) composition.getBounds().height();
      return Math.min(maxScaleX, maxScaleY);
    }
docs: If the composition is larger than the canvas, we have to use a different method to scale it up.
  See the comments in {@link #draw(Canvas)} for more info.