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

Mark Lines have Bad Anchors #247

Closed
johannes-wolf opened this issue Oct 11, 2023 · 4 comments · Fixed by #255 or #314
Closed

Mark Lines have Bad Anchors #247

johannes-wolf opened this issue Oct 11, 2023 · 4 comments · Fixed by #255 or #314
Labels
core:draw ✏️ question ❔ Further information is requested

Comments

@johannes-wolf
Copy link
Member

See: #246. The anchors seem to get moved with the mark, which is wrong.

@johannes-wolf johannes-wolf added bug 🐛 Something isn't working core:draw ✏️ labels Oct 11, 2023
@JuliDi
Copy link

JuliDi commented Oct 12, 2023

Not sure whether this is related, but if you increase the stroke to, say e.g. 2pt, it will also be placed incorrectly.
Screenshot 2023-10-12 at 21 05 30

@johannes-wolf
Copy link
Member Author

Can you post the source used to generate the image? To get the start/end of a line use the "start" and "end" anchors, as "left", "right", ... default to the bounding box, which does not take the stroke into account and therefore is a bit smaller than expected!

@johannes-wolf johannes-wolf added question ❔ Further information is requested and removed bug 🐛 Something isn't working labels Oct 13, 2023
@JuliDi
Copy link

JuliDi commented Oct 13, 2023

Sure, this is where it happens:

#import "@preview/cetz:0.1.2": canvas, draw, tree

#canvas(length: 1cm, {
  import draw: *

  rect((0,0), (1,1), name: "rect")
  line("rect.top", (rel: (0, 2)), mark: (start: ">"), stroke: 2pt)
})

Seems to be caused directly by the stroke. With default stroke it looks alright.

@johannes-wolf
Copy link
Member Author

Fixed with #314.

@fenjalien fenjalien linked a pull request Nov 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core:draw ✏️ question ❔ Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants