calculateCompensation method

double calculateCompensation(
  1. double currentRatio,
  2. double max
)

Implementation

double calculateCompensation(double currentRatio,double max) {
  final ratioDiff = baseRatio - currentRatio;
  final maxDiff = baseRatio - maxRation;
  return min(max, max * (ratioDiff / maxDiff));
}