lerp static method

SizeUnit lerp(
  1. SizeUnit a,
  2. SizeUnit b,
  3. double t
)

Linearly interpolates between two size units.

This creates a smooth transition between different sizing strategies, useful for animations or responsive design.

Implementation

static SizeUnit lerp(SizeUnit a, SizeUnit b, double t) {
  if (t <= 0.0) return a;
  if (t >= 1.0) return b;
  return a * _FixedSize(1.0 - t) + b * _FixedSize(t);
}