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 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Fable 5 committed 2026-07-23 07:23:10 +03:00
1 parent bfcc71678a
commit f72852e94b
2 files changed
+6 -2

No files matched your search

+4 -1
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
+2 -1
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