scaleY property
Derived Y scale (convenience accessor).
This derives the sign from the matrix determinant and the local axis direction. For general affine transforms (shear), this is a convenience accessor and may not match a unique decomposition.
For flips (det < 0), this accessor encodes the reflection sign while
scaleX remains a non-negative magnitude (canonical TRS(+flip)
decomposition together with rotationDeg).
Implementation
double get scaleY {
final t = transform;
assert(
t.a.isFinite && t.b.isFinite && t.c.isFinite && t.d.isFinite,
'SceneNode.scaleY requires finite transform.',
);
final c = t.c;
final d = t.d;
final syAbs = math.sqrt(c * c + d * d);
if (!syAbs.isFinite) return 0;
if (nearZero(syAbs)) return 0;
final a = t.a;
final b = t.b;
final det = a * d - b * c;
if (isNearSingular2x2(a, b, c, d) || !det.isFinite) return syAbs;
final sign = det < 0 ? -1.0 : 1.0;
final out = sign * syAbs;
return out.isFinite ? out : 0;
}
Implementation
set scaleY(double value) {
_requireTrsTransformForConvenienceSetter(transform, 'scaleY');
transform = Transform2D.trs(
translation: position,
rotationDeg: rotationDeg,
scaleX: scaleX,
scaleY: value,
);
}