fix(hatch): radial gradient stops run outside-in

SPHERICAL/HEMISPHERICAL gradients painted colour 1 at the centre;
AutoCAD's convention is colour 1 at the rim and colour 2 at the centre
(the INV variants swap them back). Both the native and the WebGL2
shader now mix the radial branch outside-in; linear/cylinder/curved
are untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-07-23 07:23:10 +03:00
commit f72852e94b
2 changed files with 6 additions and 2 deletions

View file

@ -313,7 +313,10 @@ fn check_family(
if (inst.grad_kind & 16u) != 0u {
t = 1.0 - t;
}
return mix(inst.color, inst.color2, t);
// Radial stops run OUTSIDE-IN: colour 1 at the rim, colour 2 at the
// centre (AutoCAD's SPHERICAL/HEMISPHERICAL convention; the INV bit
// above swaps them back).
return mix(inst.color2, inst.color, t);
}
// 3. Pattern LOD: when the densest family's spacing projects below

View file

@ -268,7 +268,8 @@ fn check_family(
if ginv {
t = 1.0 - t;
}
return mix(h.color, h.color2, t);
// Radial stops run outside-in (colour 2 at the centre) see hatch.wgsl.
return mix(h.color2, h.color, t);
}
// Pattern LOD: when the densest family projects below 2 px, lines blur into