Commit 035e1e2
authored
Improve viewer hover highlighting and fix text rendering (#199)
## 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 pass1 parent c216f41 commit 035e1e2
File tree
4 files changed
+180
-150
lines changed- crates/gdsr-viewer/src
- viewport
4 files changed
+180
-150
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
341 | 344 | | |
342 | 345 | | |
343 | 346 | | |
| 347 | + | |
344 | 348 | | |
345 | 349 | | |
346 | 350 | | |
| |||
372 | 376 | | |
373 | 377 | | |
374 | 378 | | |
375 | | - | |
| 379 | + | |
376 | 380 | | |
377 | 381 | | |
378 | 382 | | |
| |||
0 commit comments