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

Wrong marks in merged paths #511

Open
Wallbreaker5th opened this issue Feb 23, 2024 · 4 comments
Open

Wrong marks in merged paths #511

Wallbreaker5th opened this issue Feb 23, 2024 · 4 comments
Labels
bug 🐛 Something isn't working

Comments

@Wallbreaker5th
Copy link

#import "@preview/cetz:0.2.0"

#cetz.canvas({
  import cetz.draw: *
  merge-path({
    line((0,1), (1,1), mark: (symbol: ">"))
  })
  line((0,0), (1,0), mark: (symbol: ">"))
})

b

@johannes-wolf
Copy link
Member

This is a known problem, for now you must not use marks inside merge-path.

@johannes-wolf johannes-wolf added the bug 🐛 Something isn't working label Feb 23, 2024
@jason-s
Copy link

jason-s commented Jun 4, 2024

Is there another way to draw a polyline with an arrowhead?

@johannes-wolf
Copy link
Member

It is possible with the current version by implementing the mark placement in a custom element.
I will post an example later. But you can take a look into cetz source code how it is done: src/draw/shapes.typ has calls to drawables = mark_.place-marks-along-path(ctx, style.mark, transform, drawables). You need to do add that to your custom merge-path like element.

@johannes-wolf
Copy link
Member

If you mean multiple connected straight lines by polyline: this is possible. You can pass > 2 coordinates to line.

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

No branches or pull requests

3 participants