Skip to content

Improve viewer hover highlighting and fix text rendering#199

Merged
MatthewMckee4 merged 1 commit intomainfrom
improve-viewer-hover-and-text-rendering
Mar 5, 2026
Merged

Improve viewer hover highlighting and fix text rendering#199
MatthewMckee4 merged 1 commit intomainfrom
improve-viewer-hover-and-text-rendering

Conversation

@MatthewMckee4
Copy link
Owner

Summary

  • Replace the separate yellow overlay hover highlight with in-place element re-rendering using brighter fill (doubled alpha) and bolder stroke (3px), so the highlight always matches the element's actual shape at every zoom level
  • Expand query_point to check a 3×3 neighbourhood of spatial grid cells, eliminating hover detection misses near cell boundaries
  • Add edge tolerance (3px / zoom) to Polygon and GdsBox hit tests for more reliable hover near edges
  • Fix text and node elements not rendering when they are the only elements in a spatial grid cell — point bboxes produced zero-size cells that were incorrectly culled

Test plan

  • Open a GDS file and hover over elements at various zoom levels — highlight should match element shape exactly
  • Hover near element edges and cell boundaries — hover should activate reliably
  • Open a cell containing only text elements — text should be visible
  • Run cargo nextest run -p gdsr-viewer — all 134 tests pass

…y cells

- Replace separate yellow overlay highlight with in-place element re-rendering
  using brighter fill and bolder stroke, so highlights match element shape at
  all zoom levels
- Expand spatial grid query_point to check 3×3 cell neighbourhood, eliminating
  hover misses near cell boundaries
- Add edge tolerance to Polygon and GdsBox hit tests for more reliable hover
- Fix text/node elements not rendering when they are the only elements in a
  spatial grid cell (point bboxes caused zero-size cell culling)
@MatthewMckee4 MatthewMckee4 added the viewer GDS viewer and visualization label Mar 5, 2026
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 26.71233% with 107 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/gdsr-viewer/src/drawable.rs 15.62% 81 Missing ⚠️
crates/gdsr-viewer/src/viewport/mod.rs 0.00% 23 Missing ⚠️
crates/gdsr-viewer/src/app.rs 0.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
crates/gdsr-viewer/src/spatial.rs 99.69% <100.00%> (+0.01%) ⬆️
crates/gdsr-viewer/src/app.rs 0.00% <0.00%> (ø)
crates/gdsr-viewer/src/viewport/mod.rs 48.20% <0.00%> (-2.31%) ⬇️
crates/gdsr-viewer/src/drawable.rs 39.83% <15.62%> (+2.45%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MatthewMckee4 MatthewMckee4 merged commit 035e1e2 into main Mar 5, 2026
9 checks passed
@MatthewMckee4 MatthewMckee4 deleted the improve-viewer-hover-and-text-rendering branch March 5, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

viewer GDS viewer and visualization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant