[Bug]: layout.addElement of a grid or an extent indicator drops the parameters it doesn't read, without a word
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
Direzione di ricerca
I due rami per grid ed extentIndicator in crates/engine/src/cmd/layout.rs ritornano prima di place(...), quindi le chiavi del box non vengono mai lette. Inizia dai rifiuti esistenti per tipo per color, fill e outline in quel file e segui il loro schema, aggiungendo un elenco di chiavi per tipo accanto a ciascun ramo. È completato quando entrambi i comandi di riproduzione nell'issue falliscono con un messaggio che nomina la chiave ed elenca ciò che il tipo legge, e le chiamate senza quelle chiavi si comportano come prima.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Before you start
- I searched the existing issues and did not find a duplicate.
- This is a bug report, not a usage question (questions belong in Discussions).
What happened?
layout.addElement of a grid or an extentIndicator accepts parameters those kinds don't read and drops them without a word: the command succeeds and the result is the same as without them. Both go on a map frame and have no box or text of their own, so a script that gives x, y, w and h to place one sees a success and nothing placed.
The general notice for unread parameters (#154) doesn't cover this. It names the keys that no kind reads (layout.addElement ignores 'bogus' (it reads …)), and x, text or angle are read by other kinds. A few keys are refused kind by kind (color, fill and outline since #1455, font, radius, dash, rotation, wrap, the chart options, background on these two), and the rest are not.
In crates/engine/src/cmd/layout.rs the two arms return before place(...), so the box is never read.
Found in the review of #2872 (https://github.com/opengeos/RustGIS/pull/2872#discussion_r4687903793), which fixes it for its own new kind, the section line.
Steps to reproduce
With RustGIS 0.8.0:
rustgis-cli run --sample --cmd 'layout.new={"name":"L"}' --cmd 'layout.addElement={"kind":"grid","step":20}' --save g0.rgis
rustgis-cli run --sample --cmd 'layout.new={"name":"L"}' --cmd 'layout.addElement={"kind":"grid","step":20,"x":10,"y":10,"w":50,"h":50,"text":"hi","angle":30,"divisions":4}' --save g1.rgis
Both print {"element": 1} and nothing else, and the layouts of the two files are equal. The same happens with an extent indicator (layout.duplicateElement gives the second frame, 7):
rustgis-cli run --sample --cmd 'layout.new={"name":"L"}' --cmd 'layout.duplicateElement={"element":1}' --cmd 'layout.addElement={"kind":"extentIndicator","frame":7,"of":1,"x":10,"w":50,"text":"hi","step":5,"bold":true}' --save e1.rgis
Expected behavior
A key that the kind doesn't read is refused before anything changes, with a message that names it and lists what the kind reads, as layout.update does for a section object in #2872:
layout.addElement: a grid takes no "x" (it reads layout, kind, frame, type, crs, step, …)
A null value counts as not given, as it does for the keys refused today. Clean calls say nothing.
Choices in this proposal:
- Refuse, not warn. The keys already checked by kind are refused, and a placed grid that isn't placed is an unusable result rather than an approximate one.
- One list of keys per kind, next to its arm, rather than one more constant per key: a key added later to another kind is then refused here too.
- These two kinds first. The others drop keys too: on 0.8.0,
{"kind":"rectangle","text":"hi","angle":30,"divisions":4,"step":5,"units":"miles"}and{"kind":"text","text":"a","step":5,"divisions":4,"ticks":3,"angle":20,"head":"end"}both succeed with no notice. They read more keys each, so their lists are better done on their own afterwards, the same way.
How are you running RustGIS?
Command line (rustgis-cli)
Version
v0.8.0. The two arms read the same on main (7ecae773), where I read the code but didn't run it.
Operating system, browser and graphics
Windows 11
- Lingua principale
- Rust
- Stelle
- 1.9k
- Fork
- 268
- Merge medio
- 8h 43m
- PR unite (30g)
- 931
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di opengeos/RustGIS
-
[Bug]: Add Data's question says "Link to the file" for a GeoPackage where small tables are copiedApertaunconfirmed possible issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: The ribbon's "tool active · Esc to stop" indicator is invisible to screen readersForse già presa @jgregoriorincon l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
opengeos/RustGIS#2960 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: A plugin command's dialog with a long help opens with only two rows of its fields in viewForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
opengeos/RustGIS#1446 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di opengeos/RustGIS
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
autofixer: follow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tursodatabase/turso#12531 ·
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
userFRM/egui-charts#4292 ·
I maintainer di solito rispondono entro 1 giorno
-
CHANGELOG.md out of dateApertaIssue-Bug Need-Review
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
PowerShell/DSC#1832 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Tripstack-Corp/spyc#1352 ·
I maintainer di solito rispondono entro 1 giorno