Skip to content

Commit

Permalink
fix bug with partially-NaN coords
Browse files Browse the repository at this point in the history
  • Loading branch information
Jollywatt committed Nov 30, 2024
1 parent d24fb76 commit fc5392b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils.typ
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

#let is-length-vector(v) = v.all(x => type(x) == length)
#let is-number-vector(v) = v.all(x => type(x) in (int, float))
#let is-nan-vector(v) = is-number-vector(v) and v.all(x => float(x).is-nan())
#let is-nan-vector(v) = is-number-vector(v) and v.any(x => float(x).is-nan())


#let lerp(a, b, t) = a*(1 - t) + b*t
Expand Down
Binary file modified tests/anchors/ref/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions tests/anchors/test.typ
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,16 @@ Node positions depending on other nodes' anchors

#diagram(
node((0,0), [Alpha], name: <A>, fill: green),
node((1,1), [Beta], name: <B>, fill: yellow),
node(<A.north-east>, $ times.circle $),
edge(<A>, "->", auto),
node((rel: (0pt, -20pt), to: <A.south>), $ plus.circle $, inset: 0pt, name: <B>),
node((rel: (10pt, 0pt), to: <B>), $ f $),
node((rel: (0pt, -20pt), to: <A.south>), $ plus.circle $, inset: 0pt, name: <C>),
node((rel: (10pt, 0pt), to: <C>), $ f $),
edge(
<A>,
((), "-|", (<A.east>, 50%, <B.west>)),
((), "|-", <B>),
<B>,
"..>",
)
)

0 comments on commit fc5392b

Please sign in to comment.