Small internal utility that scales nullable Z-index integers by a constant factor (4096) to ensure declared Z values dominate sibling ordering. It multiplies a nullable int by the factor and returns a nullable int.
namespace Goo.Internal;
// The engine paints siblings per parent in ascending SiblingIndex + ZIndex order,
// so an unscaled declared z is out-bid by any sibling declared far enough later.
// Scaling by more than any realistic child count makes a declared z dominate
// document order outright: distinct values never tie, equal values resolve by
// sibling index, negatives sort behind. Undeclared (null) passes through.
internal static class ZIndexScaling
{
internal const int Factor = 4096;
internal static int? Scale(int? declared) => declared * Factor;
}