You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it's already possible to use mark: (offset: <offset>) to shorten lines with marks.
but you can't shorten arbitrary unmarked lines. would be nice to have a generic shorten option on line
Another possibility would be to honor the offset even when the symbol is none:
#import"@preview/cetz:0.3.2"#cetz.canvas({
import cetz.draw: *
line((0, 0), (4, 0))
// Doesn't work, but this could be fixed?
line((0, -1), (4, -1), mark: (end: none, offset: 1cm))
// Works but ugly:
line((0, -2), (4, -2), mark: (end: ">", offset: 1cm, scale: 0))
})
But I guess having a shorten option on paths would be cleaner. It could take a value (number or ratio) or a dict (start: ..., end: ...).
Edit: I'm not sure honoring the offset when the symbol is none would be a good idea: if the user does line((0, 0), (4, 0), mark: (end: ">", offset: 1cm)), the start mark is none, and it probably should not be shortened. So a shorten option seems like a better solution to me.
it's already possible to use
mark: (offset: <offset>)
to shorten lines with marks.but you can't shorten arbitrary unmarked lines. would be nice to have a generic shorten option on
line
Originally posted by @johannes-wolf in #788 (comment)
The text was updated successfully, but these errors were encountered: