fix(render): match model lineweight preview curve

This commit is contained in:
Hakan Seven committed 2026-09-02 23:28:34 +03:00
1 parent 76bdab1e5b
commit 2cd1d36661
7 files changed
+74 -16

No files matched your search

+3 -2
View File
@@ -25,8 +25,9 @@ pub struct Uniforms {
/// zooming inside MSPACE changes one scalar instead of re-tessellating and
/// re-uploading every dashed wire.
pub linetype_scale: f32,
/// Multiplier for screen-space lineweights. Model space uses the user's
/// preview scale; paper layouts derive it from the current paper zoom.
/// Positive values scale paper-space lineweights directly. Negative values
/// carry the model-space preview scale; lineweight shaders then apply the
/// model preview curve before multiplying by its magnitude.
pub lineweight_scale: f32,
// ── Relative-to-eye (double-single) additions ───────────────────────────
+1 -1
View File
@@ -3848,7 +3848,7 @@ impl Scene {
self.document.header.lineweight_display || display_plot_lineweights,
);
if self.current_layout == "Model" {
uniforms.lineweight_scale = self.model_lineweight_scale;
uniforms.lineweight_scale = -self.model_lineweight_scale;
} else {
let paper_per_pixel = 2.0 * self.camera.borrow().ortho_size() / canvas.1.max(1.0);
let paper_units_per_mm = self.paper_space_unit_factor() as f32;