Repository navigation
test(render): keep polygon label blockers clear of neighbouring places - #3587
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
| // Cover this place, not its neighbours: at a tilt the inside label point can be | ||
| // close enough to the bottom edge that a normal-size blocker also hides the last | ||
| // outside place with some fonts (Segoe UI and the built-in Ubuntu Light). | ||
| m.layers.last_mut().unwrap().labels.default.size = 2.0; |
There was a problem hiding this comment.
This write hits the wrong layer, so the blocker is still normal size and the Lake label is shrunk instead.
Map::insert_on_top (crates/map/src/lib.rs:3254) does self.layers.insert(0, layer), so the newest layer is at index 0, not the end. block adds the blocker through add_dataset, which calls insert_on_top, so the stack after the first block is [blocker, Lake]. Map::new starts with no layers (lib.rs:2511), so m.layers.last_mut() returns the Lake layer. The line therefore sets the Lake label's font size (symbology.rs:3013) to 2.0 on every pass, and the blocker keeps its default size. The fixture no longer does what the comment says, and the test's subject (the Lake label's size) has changed, so a passing result doesn't show the blocker fix works. I haven't been able to run the test here, so I can't say whether it passes by accident.
Suggested fix (the top of the stack is first_mut):
| m.layers.last_mut().unwrap().labels.default.size = 2.0; | |
| m.layers.first_mut().unwrap().labels.default.size = 2.0; |
Consider also setting the blocker size inside block/block_at (the layer id is known there), so the test doesn't depend on layer order.
Category: bug
There was a problem hiding this comment.
Fixed in 095ae6a. block and block_at now return the inserted layer's ID, and this fixture resizes that exact blocker. An assertion verifies that the polygon label remains at size 10. Restoring the old last_mut write fails that assertion (2 versus 10); the corrected fixture passes with both the built-in and installed fonts. The full Linux fork gate passed on this head.
Code reviewBugs
Security
Performance
Quality
AGENTS.md
Checked
Change sizeCompared with main (merge base bd87062 to PR head e9df031).
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the |
Code reviewI reviewed the one-file change to Bugs: None found. The earlier wrong-layer write ( Security: None. Test-only change. Performance: None. The test now runs one render per place, which the PR measured as roughly 1.35 s to 2.16 s per process. Quality:
Twins: The PR fixes only the test at line 797. The tilted test around lines 1061–1100 (pitch 30, AGENTS.md: No breaks found. The change is test-only, so the never-crash, never-silent and wasm rules do not apply. The new Prior reviews: One thread from github-actions (the wrong-layer write). The author fixed it in 095ae6a and replied, and the thread is marked outdated. I did not re-raise it. Concerns left alone: 1. Change sizeCompared with the base branch: the whole PR against main (merge base bd87062 to PR head 095ae6a).
|
|
The inside-placement twin, Helper deduplication and named size constants are left for the release quality pass. |
Summary
The polygon-placement order test fails with Segoe UI on both Windows runners and with the built-in Ubuntu Light font. At a 30-degree tilt, its normal-size interior blocker also covers the last bottom candidate, so the test reports seven outside positions although the renderer generates all eight.
Use small blockers for this fixture, addressed by their returned layer IDs, covering each chosen position without hiding its neighbours. An assertion keeps the polygon label at its original size. The expected eight-position order is unchanged. This changes one test; desktop, browser, CLI, Python, phone and command behavior are unchanged.
Testing
RUSTGIS_BUILTIN_FONTS=1; the installed server font passes the original test.UI evidence
No visible UI change.
Related issue
Unblocks #2931; the identical Windows assertion also fails on main.
Summary by CodeRabbit
ROUNDsetting are retained. These updates affect validation coverage only; no end-user-visible behavior changes are included.