estimateSourceUnderlayPaintBounds function
Returns the paint estimate produced by one underlay from the ORIGINAL source bounds.
Underlays never expand from previously accumulated underlay bounds.
Implementation
Rect2D? estimateSourceUnderlayPaintBounds(
Rect2D sourceBounds,
CanvasSourceUnderlay underlay,
) {
return switch (underlay) {
ShadowEffect(:final offset, :final blurSigma) =>
shadowContributesToPaint(underlay)
? sourceBounds
.inflate(shadowBlurExtentInSigmas * blurSigma)
.translate(offset)
: null,
};
}