typst / typst/typst

Corner of stroke where one side is dashed is not joined properly

Open
#6,356 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug visualize
Dominant language
Rust
Stars
56.1k
Forks
1.7k
Avg merge
3d 10h
Merged PRs (30d)
22

Description

Description
#set page(width: 100pt, height: 50pt)
#scale(500%, origin: top + left, box(stroke: (top: 1pt, right: stroke(thickness: 1pt, dash: (0.4em, 0.5em))), [abc#h(0.1em)]))

The right side of the top line is mitered as if it would be joined with the right line, but the top side of the right line is just a butt, i.e., exactly the same as if there was no top stroke at all, so it looks weird.

Image described above

This could be related to #6341, so it would probably be good to fix that first and see if this goes away too.

Reproduction URL

No response

Operating system

Linux

Typst version
  • I am using the latest version of Typst

Contributor guide

Open the contributing guide

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.

Research direction

Start by running the Typst snippet in the issue and compare the corner where the solid top stroke meets the dashed right stroke. Trace the stroke-rendering entry point responsible for joining these segments, then verify that the corner is joined consistently rather than treating the dashed side as absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.