git.lucas.co / cce-designer
graphic design tool
git clone https://git.lucas.co/cce-designer.git

commit41266d74fcbb50cf22d75ba7b61c823c27f1c567
parentf4d9192713
authorLucas Galante <lsgalante12@gmail.com>
date2026-09-29 18:04
fix: the camera pivot's size leaves its line width alone

The size scaled the beams' thickness with their length, so a small
marker was also too thin to see.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

 CLAUDE.md       |  3 ++-
 src/geometry.rs |  5 ++++-
 src/main.rs     | 17 +++++++++++++++++
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/CLAUDE.md b/CLAUDE.md
index 541cbe0..bb87114 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -2182,7 +2182,8 @@ until then it was one list of some twenty rows). The menu itself holds
 what is done — Frame All, View 1:1 — the guides (Show Grid, Show Origin,
 and since 2026-09-29 Show Camera Pivot with a Camera Pivot Size slider
 under it, 0–1 by a twentieth (the palette row is the coarse one, whole
-tenths up to 5), which until then were in the Guides
+tenths up to 5; the size is the LENGTH of the marker's beams, whose
+thickness is fixed), which until then were in the Guides
 menubar and the palette only;
 the reference CUBE guide was removed on 2026-09-25 — its command, mesh,
 RT-scene copy, settings field and menubar item, with the Guides menubar
diff --git a/src/geometry.rs b/src/geometry.rs
index 5f252e7..0d0b863 100644
--- a/src/geometry.rs
+++ b/src/geometry.rs
@@ -5914,9 +5914,12 @@ pub fn points_vertices(src: &[Vertex3D], size: f32, color: [f32; 3]) -> Vec<Vert
     out
 }
 
+/// The camera-pivot marker: three axis beams from the pivot. `scale` is
+/// their LENGTH alone; the thickness is fixed, so a small marker is short
+/// rather than too thin to see.
 pub fn camera_pivot_vertices(scale: f32) -> Vec<Vertex3D> {
     let mut verts = Vec::new();
-    let t = 0.002 * scale; 
+    let t = 0.002;
     let len = 0.4 * scale;
     
     // Red for X-axis
diff --git a/src/main.rs b/src/main.rs
index 3c4d8d8..80b7bb7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2359,6 +2359,23 @@ mod tests {
         assert!(crate::app::DesignSettings::from_kdl_str(&kdl).viewport.show_camera_pivot_enabled, "persisted");
     }
 
+    /// The pivot marker's size is the length of its beams; their thickness
+    /// does not follow it.
+    #[test]
+    fn the_camera_pivot_size_leaves_the_line_width_alone() {
+        // The X beam: its extent along x is the length, along y the width.
+        let extent = |scale: f32, axis: usize| {
+            let v = crate::geometry::camera_pivot_vertices(scale);
+            let beam: Vec<_> = v.iter().filter(|p| p.color[0] > 0.5).collect();
+            let lo = beam.iter().map(|p| p.position[axis]).fold(f32::MAX, f32::min);
+            let hi = beam.iter().map(|p| p.position[axis]).fold(f32::MIN, f32::max);
+            hi - lo
+        };
+        assert!((extent(1.0, 0) - 2.0 * extent(0.5, 0)).abs() < 1e-6, "the length follows the size");
+        assert!((extent(1.0, 1) - extent(0.25, 1)).abs() < 1e-7, "the width does not");
+        assert!(extent(0.25, 1) > 0.0);
+    }
+
     /// Camera Pivot Size is a slider under Show Camera Pivot, over 0–1:
     /// the wheel steps a twentieth, re-bakes the marker and nothing else,
     /// and saves.