Skip to content

Honor merge-path styles set with set-style - #1150

Merged
johannes-wolf merged 1 commit into
cetz-package:0.5.4from
Don-Yin:fix-merge-path-style-755
Oct 27, 2026
Merged

johannes-wolf merged 1 commit into
cetz-package:0.5.4from
Don-Yin:fix-merge-path-style-755

Conversation

@Don-Yin

@Don-Yin Don-Yin commented Oct 22, 2026

Copy link
Copy Markdown

Fixes #755.

merge-path was resolving the top-level style, so set-style(merge-path: (...)) had no effect. This adds a merge-path styling root with inherited defaults and documents it. Inline styles still take precedence.

The new regression checks stroke, fill, fill-rule and marks, including inheritance and inline overrides. On 83c0015, the suite has 118 passes and only the new test fails; with this change, all 119 pass.

Checked with Typst 0.15.1 and tytanic 0.4.1:

  • tt run --no-fail-fast
  • Direct compilation of the regression test
  • Package installation, manual compilation and documentation generation using the justfile recipes
  • git diff --check

The comparison below reads the final drawable's stroke width for the same 3 pt request, set globally, at the named root, or inline (probe and data).

Merged-path stroke widths before and after the fix

Resolve the merge-path styling root and inherit the existing top-level
stroke, fill, fill-rule and mark defaults. Add a drawable-property
regression for named styles, inheritance and inline overrides, and
document the styling root.

Fixes cetz-package#755

Signed-off-by: Don Yin <Don_Yin@outlook.com>
@johannes-wolf
johannes-wolf self-requested a review October 22, 2026 14:24

@johannes-wolf johannes-wolf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@johannes-wolf
johannes-wolf changed the base branch from master to 0.5.4 October 27, 2026 11:42
@johannes-wolf johannes-wolf added this to the 0.5.4 milestone Oct 27, 2026
@johannes-wolf
johannes-wolf merged commit 2a490c0 into cetz-package:0.5.4 Oct 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot set styles for merge-path in set-style

2 participants