Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Bug]: Split-screen target width assumes a 16px gap but the renderer uses 6px

Aperta Adatta ai principianti
#30 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
backend, desktop

Direzione di ricerca

Inizia da crates/app/src/export.rs, in corrispondenza di compute_split_scale_for_width(), e confronta il valore della spaziatura con SPLIT_GAP in crates/renderer/src/canvas.rs e crates/renderer/src/svg.rs. Verifica se il crate del renderer espone una definizione condivisa in layout.rs, come suggerisce l’issue. Il lavoro è concluso quando le esportazioni a schermo diviso corrispondono alla larghezza obiettivo richiesta, entro l’arrotondamento, sia per PNG che per SVG.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug good first issue
What happened?

The target width computation for split-screen mode assumes a 16px gap between the two panels, but the renderer uses a 6px gap. The computed scale is therefore slightly wrong and the exported image is 10 * scale device pixels narrower than the requested target width.

Steps to reproduce
  1. Enable split-screen comparison.
  2. Set a target width, for example 1920.
  3. Export PNG and measure the actual image width. It falls short of the target.
Expected behavior

The exported image matches the requested target width (within rounding).

Actual behavior

compute_split_scale_for_width() in crates/app/src/export.rs:266 uses the magic number 16.0 for the gap, while the drawing code uses SPLIT_GAP = 6.0 (crates/renderer/src/canvas.rs:376, crates/renderer/src/svg.rs:250).

Where did it go wrong?

PNG export / SVG export (split mode)

Settings

Split-screen enabled, target width set.

Browser

Not browser specific.

CodeFrame version

0.7.0

Console output or extra context

Suggested fix: export SPLIT_GAP from the renderer crate and use it in export.rs instead of the local literal. The constant is currently duplicated in canvas.rs and svg.rs, so a single shared definition in layout.rs would remove the duplication at the same time.

Lingua principale
Rust
Stelle
1
Fork
0
Merge medio
1g 7h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di suradet-ps/codeframe

Tutte le issue di suradet-ps/codeframe

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.