Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipping with a radius doesn't work on elements without a border-stroke #2533

Closed
1 task done
freundTech opened this issue Oct 31, 2023 · 1 comment · Fixed by #2626
Closed
1 task done

Clipping with a radius doesn't work on elements without a border-stroke #2533

freundTech opened this issue Oct 31, 2023 · 1 comment · Fixed by #2626
Labels
bug Something isn't working layout Related to layout, positioning, etc.

Comments

@freundTech
Copy link
Contributor

freundTech commented Oct 31, 2023

Description

As of Typst 0.9.0 setting clip: true on a box or block should take into account the corner radius of the box or block instead of just clipping to a rectangle. See #2338.

This however doesn't work if the box or block doesn't have stroke set or has stroke set to none.

This works:

#block(
  stroke: black,
  radius: 5pt,
  width: 20pt,
  height: 20pt,
  clip: true,
  rect(fill: green, width: 100%, height: 100%)
)

This doesn't:

#block(
  radius: 5pt,
  width: 20pt,
  height: 20pt,
  clip: true,
  rect(fill: green, width: 100%, height: 100%)
)

EDIT: It's possible to work around this limitation (as far as I can tell without any side-effects) by manually setting stroke: 0pt.

Reproduction URL

https://typst.app/project/rwRXVc5tF0Q6QtGL86LE-3

Operating system

Web app

Typst version

  • I am using the latest version of Typst
@freundTech freundTech added the bug Something isn't working label Oct 31, 2023
@freundTech
Copy link
Contributor Author

I only searched for duplicate issues before posting this one, but just noticed there is already a PR fixing this one: #2526

I'll still leave this issue open until that PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working layout Related to layout, positioning, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants