#1063: keep the Gradient Ramp inside the layer's alpha

The Gradient Ramp wrote alpha 1.0 to every pixel, so a shape layer's transparent area filled up with
the ramp and the layer's bounds showed instead of the shape. The ramp now uses the pixel's own alpha
on the CPU and in the GPU kernel, as the #939 fix does for the noise effects. A regression test
checks that transparent pixels stay transparent at two Blend With Original values.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
This commit is contained in:
Kristian MyramandClaude Haiku 5.5 committed 2026-10-13 01:37:03 +02:00
1 parent 470ea7a3af
commit 8eece41c7e
2 files changed
+23 -2

No files matched your search

+2 -1
View File
@@ -806,7 +806,8 @@ fn pointwise(@builtin(global_invocation_id) gid: vec3<u32>) {
t = clamp(t, 0.0, 1.0);
let c0 = P.f[1].xyz;
let c1 = P.f[2].xyz;
px = put(px, c0 + (c1 - c0) * t, 1.0, P.f[3].z);
// Keep the source alpha, as the CPU path does (#1063): the ramp fills only the shape.
px = put(px, c0 + (c1 - c0) * t, px.w, P.f[3].z);
}
case 10u: {
let contrast = P.f[0].x;