Skip to content

Add ruler/measurement tool to viewer#189

Merged
MatthewMckee4 merged 4 commits intomainfrom
ruler-measurement-tool
Mar 5, 2026
Merged

Add ruler/measurement tool to viewer#189
MatthewMckee4 merged 4 commits intomainfrom
ruler-measurement-tool

Conversation

@MatthewMckee4
Copy link
Owner

Summary

  • Adds a ruler/measurement tool that lets the user click two points to measure the distance between them in world coordinates
  • Distance displayed in appropriate units (nm, µm, mm) depending on magnitude
  • Activated via R key or View → Ruler menu, cancelled with Escape
  • Live preview line follows cursor after first click is placed

Closes #147

Test plan

  • 11 new tests covering state machine (toggle, click workflow, cancel), Euclidean distance calculation, and distance formatting with inline snapshots
  • All 106 viewer tests pass
  • All pre-commit checks pass

Press R to activate the ruler, click two points to measure the distance
between them. Distance is displayed in nm, µm, or mm depending on scale.
Escape cancels an in-progress measurement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MatthewMckee4 MatthewMckee4 added enhancement New feature or request viewer GDS viewer and visualization labels Mar 5, 2026
# Conflicts:
#	crates/gdsr-viewer/src/app.rs
#	crates/gdsr-viewer/src/viewport/mod.rs
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 52.61044% with 118 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/gdsr-viewer/src/ruler.rs 64.21% 73 Missing ⚠️
crates/gdsr-viewer/src/app.rs 0.00% 31 Missing ⚠️
crates/gdsr-viewer/src/viewport/mod.rs 0.00% 14 Missing ⚠️
Files with missing lines Coverage Δ
crates/gdsr-viewer/src/main.rs 0.00% <ø> (ø)
crates/gdsr-viewer/src/viewport/mod.rs 50.50% <0.00%> (-1.44%) ⬇️
crates/gdsr-viewer/src/app.rs 0.00% <0.00%> (ø)
crates/gdsr-viewer/src/ruler.rs 64.21% <64.21%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 5, 2026

Merging this PR will improve performance by 41.09%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 1 improved benchmark
✅ 3 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
write_complex 2.3 ms 1.6 ms +41.09%

Comparing ruler-measurement-tool (05f5699) with main (327f160)

Open in CodSpeed

MatthewMckee4 and others added 2 commits March 5, 2026 13:06
Ruler tool now stays active after completing a measurement, allowing
users to place multiple rulers on screen. Escape cancels the in-progress
point but preserves completed measurements. Cmd+R clears all rulers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# Conflicts:
#	crates/gdsr-viewer/src/app.rs
#	crates/gdsr-viewer/src/viewport/mod.rs
@MatthewMckee4 MatthewMckee4 merged commit 5998aac into main Mar 5, 2026
9 checks passed
@MatthewMckee4 MatthewMckee4 deleted the ruler-measurement-tool branch March 5, 2026 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request viewer GDS viewer and visualization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Viewer: Ruler / measurement tool

1 participant