Outside the boxes' combined reach of the moved line the result is 0,
but boxes_unbounded still evaluated the prefix-sum polynomials there,
and far past the line their cancelling terms left a rounding residue
(about 5 for a one-pixel line moved a billion pixels). Those positions
are now 0 without evaluating anything. Also wraps the raster re-export
line rustfmt asks for.
With the padding cut to its budget, a Distance larger than what's left
of the margin moved the layer out of the buffer before the blur, so the
blur had nothing to spread back in: a 64 x 48 layer moved 3000 px at
Softness 8000 left no shadow at all. The cut-margin path now samples
only the fraction of the move and lets the blur move the rest:
raster::gaussian_blur_unbounded_at evaluates the transparent-edged blur
of the image at a whole-pixel shift, through a window the size of the
buffer, so content outside the window still reaches into it. Margins
that fit are unchanged.
The blur's intermediate rows are freed before the output is allocated,
so it holds at most three buffers at once. On an M-series Mac a
4096 x 4096 layer at Softness 30000 takes 0.51 s, and 1080p 0.13 s.
The table holds only Gaussian Blur's row; the ranges changed since 0.24.1
by other work are tracked in #3815. The 30000 render test checks the
buffer against crate::pixel_budget instead of a copied constant.
A Softness far past the range (an expression can set one) overflowed
the padding's u32 before drop_shadow_pad saturated it; the new test
panicked there in a debug build and renders a finite shadow now. The
GPU test's comment and the parity row now say that a cut margin renders
on the CPU, and the CPU test quotes the measured 0.11 at Softness 8000.
A zero-radius box is an identity, but as a difference of prefix sums it
kept their rounding error; those boxes are now left out (one to three
boxes, of the matching prefix-sum order). A sigma above 1e7 blurs as
1e7, wider than any buffer, so box_radii's i64 arithmetic can't
overflow on a huge or infinite sigma.
Softness took 0..1000, so prop.set and the value editors clamped values
After Effects accepts: its recorded definition for ADBE Drop Shadow
allows 0..30000 in the same pixels (the .aep mapping is plain). The hard
range is now 0..30000; the default (0) and the slider (0..250) are
unchanged. Projects saved with the old range take the new one on open.
The .aep range guard loses its allow-list row, and the engine test sets
both ends through prop.set, undo / redo, save / reopen and an old
project. Keyframe text keeps no unit for it (only 0..100 sliders read
as percent).
Drop Shadow pads its buffer by Distance + 1.5 x Softness, but the pixel
budget (#2261) cuts that margin for a large Softness: from about 870 on
a 1080p layer. The box passes then dropped what they spread past the
edge, so the shadow came out too faint: at the centre of a 64 x 48
layer, 0.11 of the Gaussian at Softness 8000. With a cut margin the CPU now blurs as
if the buffer went on with transparency (the Gaussian is unchanged,
sigma = Softness / 2). The GPU hands that case to the CPU and keeps
every margin that fits, so those results are unchanged.
Measured on an M-series Mac: 1080p at Softness 30000 takes 0.10 s, and
a 4096 x 4096 layer (an 8192 x 8192 buffer) takes 0.99 s on the CPU.
The pad is computed once for both paths (drop_shadow_pad) and saturates
instead of overflowing on a huge Softness.
The octave test asserts both values stay within OCTAVE_SCALE_MAX (it
passed with the bound removed). The comment names Perspective Offset as
what multiplies the offset by the depth, and says why an octave at the
bound has no detail.
The sub-pixel bounds lx + ix and lx + lw - ix round separately, so at third
resolution they can still cross by an ulp and f64::clamp panics; a NaN
layer size panicked too. max/min equals clamp whenever the bounds are
ordered and cannot panic. The test now covers half and third resolution at
fractional offsets and a NaN layer size. The parity note says Amount, not
the displacement, is bounded to 2^24 px.
The spin helper's name gives its unit (degrees), the zoom helper's doc
uses |amount| as the code does, and the parity row and tests say what
is and is not checked against After Effects.
Locked pinning clamped samples to lx + 0.5 .. lx + lw - 0.5. On a layer
under a buffer pixel across (a 1-pixel layer at half resolution) the bounds
cross and f64::clamp panics. They now meet at the layer's centre there and
are unchanged otherwise.
Expressions are not clamped to the hard range. Padding computed
amount.abs().ceil() as u32 + 1, which overflowed (a panic in debug builds)
from about 4.3e9 on both the CPU and GPU paths, a NaN Amount filled the
layer with NaN, and an infinite one sent infinite coordinates to the
samplers' integer pixel positions.
turbulent_amount_px, shared by both paths, skips a zero or NaN Amount and
bounds the rest to 2^24 px. Values inside the hard range are unchanged.
Tests cover both ends of the range with every displacement kind, pinning
and Resize Layer (finite, padding within budget), Amounts past it, and
CPU/GPU agreement at -10000, 10000 and infinity.