Jollywatt / typst-fletcher

Typst package for drawing diagrams with arrows, built on top of CeTZ.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`shift` field of `edge` only supports `length` and not `int`/`float` (like the coordinates do)

Andrew15-5 opened this issue · comments

shift only works with lengths and not integers/floats, which makes the use of it with funky coordinates really hard (coordinates normally are integers/floats). I tried using fractions based on set width/height to narrow the gap between length and float, but in some cases (or maybe all) the fraction from the shift (height/2) is not the same as the one in the coordinates (1/8). But probably this approach shouldn't work in the first place (setting myself up for the failure from the start).

This should be working on master now. In reality, using the diagram’s own “elastic coordinates” are a bit funny for shift, since the physical size of a unit depends on where you are in the diagram and the angle of shift. (The diagram’s coordinates stretch to fit node sizes, so are nonlinear.) But now you have the option of using those where convenient as well as physical lengths.