Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#30 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
backend, desktop

Research direction

Start in crates/app/src/export.rs at compute_split_scale_for_width() and compare its gap value with SPLIT_GAP in crates/renderer/src/canvas.rs and crates/renderer/src/svg.rs. Check whether the renderer crate exposes a shared definition in layout.rs, as the issue suggests. Done means split screen exports match the requested target width within rounding for both PNG and SVG.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Rust
Stars
1
Forks
0
Avg merge
1d 7h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from suradet-ps/codeframe

All issues in suradet-ps/codeframe

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.