Repository navigation
fix(layout): a dark basemap keeps the publication legend's box (#1379) - #2226
elpidioassinaturas wants to merge 1 commit into
Conversation
opengeos#2164 cleared a publication legend's box over any built-in basemap's water or land, Midnight's near-black too, under the legend's #222222 text. Only a light background (3:6:1 lightness of 160 or more) counts as plain now: Paper, Ocean, Atlas and Blank stay clear, Midnight keeps the box. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@coderabbitai review |
Action performed
|
Code reviewI found no correctness bugs. The threshold logic, the Midnight and Ocean test cases, and the basemap lightness values in the PR description all check out against Bugs
Security
Performance
Quality
AGENTS.md
Test coverage
Change sizeCompared with
|
📖 Docs preview
GitHub Pages takes a minute or two to publish a new commit. |
|
Superseded by #2194, which fixes the same bug on main: a publication legend over a dark basemap such as Midnight keeps its box. That PR has its own test, |
Part of #1379. Follow-up to #2164, from its last review thread, which came in after the merge.
The bug
#2164 leaves a publication legend's box clear when the frame shows only the basemap's water or land colour under it. Any built-in basemap's colours counted, Midnight's too: its water is
#1A1F26and its land#2E333A. The legend's text is fixed atLEGEND_TEXT = #222222, so over Midnight's open water the box was cleared and the legend was dark text on near-black (about 1.1:1 contrast).To reproduce: add a free corner under the Midnight basemap to
frame_plain_under_counts_everything_drawn_but_the_background. On main it reads as plain: the sampled colour is(26, 31, 38), Midnight's water. The legend would then lose its box.The fix
frame_plain_undercounts a background as plain only when it is light. Lightness is weighted 3:6:1, as the renderer's greys are, and must be at leastLIGHT_BACKGROUND = 160. Water / land lightness of the built-in basemaps:On another body the background is the land's grey from
Map::palette; with Paper that is 244, so it stays plain.Tests
frame_plain_under_counts_everything_drawn_but_the_background: Midnight's water keeps the box (this case fails on main), and Ocean's light water is plain.cargo fmt --check,cargo clippy -p rustgis-render -p rustgis-engine --all-targets -D warnings,cargo test -p rustgis-render -p rustgis-engine. Two tests fail on this Windows machine only, as they do on main:gdal_formats_open_when_gdal_is_installed(the local GDAL 3.7.1) andreload::wrong_geometry_missing_file_and_missing_chosen_table_leave_the_layer_unchanged(a Portuguese Windows error message).The user guide's legend box paragraph says a dark background keeps the box.
Limits
🤖 Generated with Claude Code
Summary by CodeRabbit
legendBox: "always".