resolveExtraSize method
The amount of space (per axis) freed by this transform for a backdrop of
size at progress t. Returns Size.zero when nothing is freed.
Implementation
@override
Size resolveExtraSize(Size size, double t, {bool isRoot = true}) {
final scale = scaleAt(t);
final sizeAfterScale = Size(size.width * scale, size.height * scale);
if (isRoot) {
// The root layer divides by the scale factor so the freed space maps back
// into the un-scaled coordinate space of the drawer that fills it. Clamp
// to zero: at low t the division can produce a small negative value, but
// the backdrop never frees negative space.
return Size(
max(0.0, size.width - sizeAfterScale.width / minScale),
max(0.0, size.height - sizeAfterScale.height / minScale),
);
}
return Size(
max(0.0, size.width - sizeAfterScale.width),
max(0.0, size.height - sizeAfterScale.height),
);
}