scale method
Returns a scaled copy with all spatial fields and text size multiplied
by factor. See FolderNodeTheme.scale for shared contract details.
Scales: width, height, padding, margin, textStyle.
Does NOT scale: tooltipTheme — see ADR-0004.
Identity: scale(1.0, defaultFontSize: …) returns this.
Implementation
ParentNodeTheme<T> scale(
double factor, {
required double defaultFontSize,
}) {
assert(factor > 0, 'scale factor must be > 0, got $factor');
if (factor == 1.0) return this;
return copyWith(
width: width * factor,
height: height * factor,
padding: padding * factor,
margin: margin * factor,
textStyle: scaleTextStyle(textStyle, factor, defaultFontSize),
// tooltipTheme intentionally not delegated — ADR-0004 (chrome).
);
}