Skip to content

Commit

Permalink
Merge pull request #1942 from 23danielsuh/issue1937
Browse files Browse the repository at this point in the history
fix: circle shape for arrowheads no longer removes all arrows
  • Loading branch information
alixander authored May 19, 2024
2 parents d791085 + 2072727 commit 04f3c1c
Show file tree
Hide file tree
Showing 7 changed files with 1,028 additions and 0 deletions.
1 change: 1 addition & 0 deletions ci/release/changelogs/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@

- Local relative icons are relative to the d2 file instead of CLI invoke path [#1924](https://github.com/terrastruct/d2/pull/1924)
- Custom label positions weren't being read when the width was smaller than the label [#1928](https://github.com/terrastruct/d2/pull/1928)
- Using `shape: circle` for arrowheads no longer removes all arrowheads along path in sketch mode [#1942](https://github.com/terrastruct/d2/pull/1942)
7 changes: 7 additions & 0 deletions d2renderers/d2sketch/sketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,13 @@ func ArrowheadJS(r *Runner, arrowhead d2target.Arrowhead, stroke string, strokeW
stroke,
BG_COLOR,
)
case d2target.CircleArrowhead:
arrowJS = fmt.Sprintf(
`node = rc.circle(-2, -1, 8, { strokeWidth: %d, stroke: "%s", fill: "%s", fillStyle: "solid", fillWeight: 1, seed: 5 })`,
strokeWidth,
stroke,
BG_COLOR,
)
}
return
}
Expand Down
27 changes: 27 additions & 0 deletions e2etests/testdata/txtar.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,30 @@ grid: {
}

out -> grid.d

-- sketch-mode-circle-arrowhead --
vars: {
d2-config: {
sketch: true
}
}

a
b
a <-> b: {
source-arrowhead: {
shape: circle
style.filled: false
}
}

x
y
z
x <-> y <-> z: {
source-arrowhead: {
shape: circle
style.filled: false
}
direction: right
}
Loading

0 comments on commit 04f3c1c

Please sign in to comment.