diff --git a/src/cetz.typ b/src/cetz.typ index 980a619..eb7ec62 100644 --- a/src/cetz.typ +++ b/src/cetz.typ @@ -1 +1 @@ -#import "@preview/cetz:0.3.4": * \ No newline at end of file +#import "@preview/cetz:0.4.0": * \ No newline at end of file diff --git a/src/core/draw/group.typ b/src/core/draw/group.typ index 083aa09..25aafaf 100644 --- a/src/core/draw/group.typ +++ b/src/core/draw/group.typ @@ -45,18 +45,14 @@ (x0, y0), (x1, y1) ) - draw.merge-path( + draw.line( + (x0, y0), + (x0 + w, y0), + (x0 + w, y0 - h / 2), + (x0 + w - 5, y0 - h), + (x0, y0 - h), fill: COL-GRP-NAME, - close: true, - { - draw.line( - (x0, y0), - (x0 + w, y0), - (x0 + w, y0 - h / 2), - (x0 + w - 5, y0 - h), - (x0, y0 - h) - ) - } + close: true ) draw.content( (x0, y0), diff --git a/src/core/draw/note.typ b/src/core/draw/note.typ index 004f1c7..d8b353d 100644 --- a/src/core/draw/note.typ +++ b/src/core/draw/note.typ @@ -49,10 +49,6 @@ return box(note.content, inset: inset) } -#let pre-render(note) = { - -} - #let render(note, y: auto, forced: false) = { if not note.linked { if not note.aligned { @@ -111,21 +107,22 @@ let y1 = y0 - h if note.shape == "default" { - draw.merge-path( + draw.line( + (x0, y0), + (x1, y0), + (x2, y0 - NOTE-CORNER-SIZE), + (x2, y1), + (x0, y1), stroke: black + .5pt, fill: note.color, - close: true, - { - draw.line( - (x0, y0), - (x1, y0), - (x2, y0 - NOTE-CORNER-SIZE), - (x2, y1), - (x0, y1) - ) - } + close: true + ) + draw.line( + (x1, y0), + (x1, y0 - NOTE-CORNER-SIZE), + (x2, y0 - NOTE-CORNER-SIZE), + stroke: black + .5pt ) - draw.line((x1, y0), (x1, y0 - NOTE-CORNER-SIZE), (x2, y0 - NOTE-CORNER-SIZE), stroke: black + .5pt) } else if note.shape == "rect" { draw.rect( (x0, y0), @@ -137,20 +134,16 @@ let lx = x0 + PAD.last() let rx = x2 - PAD.last() let my = (y0 + y1) / 2 - draw.merge-path( + draw.line( + (lx, y0), + (rx, y0), + (x2, my), + (rx, y1), + (lx, y1), + (x0, my), stroke: black + .5pt, fill: note.color, - close: true, - { - draw.line( - (lx, y0), - (rx, y0), - (x2, my), - (rx, y1), - (lx, y1), - (x0, my), - ) - } + close: true ) } diff --git a/src/core/draw/sequence.typ b/src/core/draw/sequence.typ index 81c591a..0d0ae47 100644 --- a/src/core/draw/sequence.typ +++ b/src/core/draw/sequence.typ @@ -15,10 +15,10 @@ "": none, ">": (symbol: ">", fill: color), ">>": (symbol: "straight"), - "\\": (symbol: ">", fill: color, harpoon: true, flip: true), - "\\\\": (symbol: "straight", harpoon: true, flip: true), - "/": (symbol: ">", fill: color, harpoon: true), - "//": (symbol: "straight", harpoon: true), + "\\": (symbol: ">", fill: color, harpoon: true), + "\\\\": (symbol: "straight", harpoon: true), + "/": (symbol: ">", fill: color, harpoon: true, flip: true), + "//": (symbol: "straight", harpoon: true, flip: true), "x": none, "o": none, ).at(sym) diff --git a/tests/group/ref/1.png b/tests/group/ref/1.png index 4c6b690..8ee09a4 100644 Binary files a/tests/group/ref/1.png and b/tests/group/ref/1.png differ diff --git a/tests/group/ref/2.png b/tests/group/ref/2.png index 6628385..070f238 100644 Binary files a/tests/group/ref/2.png and b/tests/group/ref/2.png differ diff --git a/tests/group/ref/3.png b/tests/group/ref/3.png index 3c8b5bb..87c8628 100644 Binary files a/tests/group/ref/3.png and b/tests/group/ref/3.png differ diff --git a/tests/note/position/ref/1.png b/tests/note/position/ref/1.png index 4ac364d..276c4b4 100644 Binary files a/tests/note/position/ref/1.png and b/tests/note/position/ref/1.png differ diff --git a/tests/note/position/ref/2.png b/tests/note/position/ref/2.png index fb6618c..c0c6d78 100644 Binary files a/tests/note/position/ref/2.png and b/tests/note/position/ref/2.png differ diff --git a/tests/note/position/ref/3.png b/tests/note/position/ref/3.png index 06d4a60..c4091b2 100644 Binary files a/tests/note/position/ref/3.png and b/tests/note/position/ref/3.png differ diff --git a/tests/note/shape/ref/1.png b/tests/note/shape/ref/1.png index e9bff45..0baabbe 100644 Binary files a/tests/note/shape/ref/1.png and b/tests/note/shape/ref/1.png differ diff --git a/tests/note/styled-body/ref/1.png b/tests/note/styled-body/ref/1.png index 49b7d78..e10a0de 100644 Binary files a/tests/note/styled-body/ref/1.png and b/tests/note/styled-body/ref/1.png differ diff --git a/tests/sequence/comment-align/ref/1.png b/tests/sequence/comment-align/ref/1.png index c3a1f6c..1cdb569 100644 Binary files a/tests/sequence/comment-align/ref/1.png and b/tests/sequence/comment-align/ref/1.png differ diff --git a/tests/sequence/comment-align/ref/2.png b/tests/sequence/comment-align/ref/2.png index 9823f8b..31185af 100644 Binary files a/tests/sequence/comment-align/ref/2.png and b/tests/sequence/comment-align/ref/2.png differ diff --git a/tests/sequence/special-par/ref/1.png b/tests/sequence/special-par/ref/1.png index aa44644..1259a7e 100644 Binary files a/tests/sequence/special-par/ref/1.png and b/tests/sequence/special-par/ref/1.png differ diff --git a/tests/sequence/tips/ref/1.png b/tests/sequence/tips/ref/1.png index c3753c5..00cff5d 100644 Binary files a/tests/sequence/tips/ref/1.png and b/tests/sequence/tips/ref/1.png differ diff --git a/tests/sequence/tips/ref/2.png b/tests/sequence/tips/ref/2.png index 7bba0e4..3725245 100644 Binary files a/tests/sequence/tips/ref/2.png and b/tests/sequence/tips/ref/2.png differ diff --git a/tests/sequence/tips/ref/3.png b/tests/sequence/tips/ref/3.png index 85bc2c2..6c12338 100644 Binary files a/tests/sequence/tips/ref/3.png and b/tests/sequence/tips/ref/3.png differ