fix(render): correct lineweight display scaling

Remove the global display boost and scale paper-space lineweights with the current sheet zoom across wire, block-wire, and hatch paths.

Fixes #962
This commit is contained in:
Hakan Seven committed 2026-09-02 22:32:53 +03:00
1 parent 0f337db488
commit edbc4d8ff8
7 files changed
+34 -24

No files matched your search

+7 -2
View File
@@ -14,7 +14,8 @@ struct Uniforms {
lwdisplay_enable: f32,
flat_shade: f32,
transparency_enable: f32,
_pad: vec2<f32>,
_linetype_scale: f32,
lineweight_scale: f32,
// Relative-to-eye (double-single): see wire.wgsl.
view_rot: mat4x4<f32>,
eye_high: vec3<f32>,
@@ -162,7 +163,11 @@ fn check_family(
-ddx_xz.x * sin_a + ddx_xz.y * cos_a,
-ddy_xz.x * sin_a + ddy_xz.y * cos_a,
)) * 0.5;
let width_px = select(1.0, max(fam.line_width, 1.0), u.lwdisplay_enable > 0.5);
let width_px = select(
1.0,
max(fam.line_width * u.lineweight_scale, 1.0),
u.lwdisplay_enable > 0.5,
);
let half_line = half_px * width_px;
// World units per screen pixel on each axis — used to light exactly the